From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 5CF683858D28 for ; Sun, 5 Dec 2021 10:51:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5CF683858D28 Received: by mail-wr1-x42c.google.com with SMTP id a9so15963342wrr.8 for ; Sun, 05 Dec 2021 02:51:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/YI79UGbaD2AzJDQlvjbUsz1O0Xhv8CYfHe3bBRGoCg=; b=n7wN7qev9fMDJwDbgsYXXgDedtU/LSddYUvXNKBhBMpBZRnHsTCr+0qj+GkiINo2gi kiCr4fOVHFCQj0oi0tCJWDXVw2fMykOmAyDI9XTBZ22IO32a8FKauLXM/aOxE1cre5ZL X9zTAxlWOAN+9ytZSnj18pH8F1OASHYwo2ZkP+b4hPJFrrt1P7n5eAdUNf7j9xqLnRXp 4fYQQ7/H+y0I/qU7ar35QthJ1V9sAH/H93I9t9w06EtxfeFxYkn0GIMTSSC1pEuGBtNu T9a0yCBZXPaeuF44Gs13PrgfVeSXfzEjPRdmuxjQ5o/dXtMDWlRvpjn1O3gpqnXOzbER pqAQ== X-Gm-Message-State: AOAM5318cmNDCfswAiUh2wuP9N9A8TN6aKwfdQ6PD9CPsHqMRc49zcBT EzyrqVaoBzWgT1dabwbKAtMh X-Google-Smtp-Source: ABdhPJwnzSk9yzLJS40q6zMbidJ9+LFIOrL5okv7AHJa4E9etJeRsMiuk0MI3dApNIO6Y9tlrEB0Ig== X-Received: by 2002:a5d:4b41:: with SMTP id w1mr35321085wrs.537.1638701468349; Sun, 05 Dec 2021 02:51:08 -0800 (PST) Received: from takamaka.home ([2a01:cb22:1d5:1100:1fb:9506:6142:fbf9]) by smtp.gmail.com with ESMTPSA id f19sm11736484wmq.34.2021.12.05.02.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Dec 2021 02:51:07 -0800 (PST) Received: by takamaka.home (Postfix, from userid 1000) id 6A14CA4B04; Sun, 5 Dec 2021 14:51:04 +0400 (+04) Date: Sun, 5 Dec 2021 14:51:04 +0400 From: Joel Brobecker To: Mark Wielaard Cc: Joel Brobecker , Pedro Alves , Overseers mailing list , simon.marchi@polymtl.ca, eliz@gnu.org, Mike Frysinger Subject: Re: setting up sim project web space Message-ID: References: <6a72ecd6-1480-1cb8-c223-c6c9d991be2e@palves.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2qqE0MIks7mFoLNY" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: overseers@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Overseers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Dec 2021 10:51:11 -0000 --2qqE0MIks7mFoLNY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, > On Thu, Nov 25, 2021 at 06:00:47AM +0400, Joel Brobecker wrote: > > > For savannah you are unfortunately stuck with CVS for webpages. But you > > > can just install a redirect to https://sourceware.org/gdb/ so you don't > > > need to keep mirroring it in two places. > > > > Sounds like an interesting idea. > > > > One of the things I'm concerned about is perhaps people having > > bookmarks of old pages. Or perhaps have every one of the current > > pages be a redirect to the corresponding page? > > > > Something like this? > > > > > > > > > > Redirecting to > > > > > > > >

Redirecting to sourceware.org

> > > > > > That should work for html pages. It is what e.g. gnutls uses. They > keep the page itself in place (so if there is any delay in the > redirection the user at least sees the old contents), and they just > add the meta http-equiv tag right after the head tag with a > content="0; (to make the redirect instantanious). > > This requires a little scripting to update all pages (let me know if > you can use help with that). I've added the redirects, with the help of the attached script. Pretty crude, but did the job. -- Joel --2qqE0MIks7mFoLNY Content-Type: text/x-python; charset=us-ascii Content-Disposition: attachment; filename="add-redirect.py" #! /usr/bin/env python3 import os def redirect_url(dirname, filename): # Use a path which is relative dirname = os.path.relpath(dirname) result = os.path.join( "https://www.sourceware.org/gdb", dirname, ) if filename == "index.html": # This is the default file for this directory. Omit the file, # but still end the URL with a '/'; not necessary, but helps # indicate that the target is a directory. result += "/" else: result = os.path.join(result, filename) return result def redirect_tag(dirname, filename): url = redirect_url(dirname, filename) return f'' def fixup(dirname, filename): file_path = os.path.join(dirname, filename) with open(file_path, 'rb') as f: contents = f.read() redirect_inserted_p = False with open(file_path, "wb") as f: for line in contents.splitlines(keepends=True): f.write(line) if not redirect_inserted_p and b"" in line.lower(): f.write(redirect_tag(dirname, filename).encode()) f.write(b"\n") redirect_inserted_p = True for dirname, _, files in os.walk("."): for filename in files: _, filename_ext = os.path.splitext(filename) if filename_ext.lower() not in (".htm", ".html"): # Not an HTML file, keep going. continue if os.path.join(dirname, filename) == "./bugs/index.html": # Already converted. Skip. continue fixup(dirname, filename) --2qqE0MIks7mFoLNY--