all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
Cc: 50568@debbugs.gnu.org
Subject: bug#50568: Missing source code
Date: Thu, 16 Sep 2021 21:45:26 +0200	[thread overview]
Message-ID: <8735q41ezt.fsf@gnu.org> (raw)
In-Reply-To: <20210914093610.u56q7ltjbwbbnf34@pelzflorian.localdomain> (pelzflorian@pelzflorian.de's message of "Tue, 14 Sep 2021 11:36:10 +0200")

[-- Attachment #1: Type: text/plain, Size: 1727 bytes --]

Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

> On Tue, Sep 14, 2021 at 10:38:55AM +0200, Ludovic Courtès wrote:
>> Hi,
>> 
>> Maxime Devos <maximedevos@telenet.be> skribis:
>> 
>> > The Wayback Machine has some copies of software at https://www.atromatic.net:
>> 
>> Thanks, they’re now all in store on berlin.
>> 
>> It’s kinda ironic that it’s the Wayback Machine that’s saving us here…
>> I wonder if there’s a way to construct generic web.archive.org URLs that
>> we could use as a fallback in (guix build download)?
>
> AFAIK Just replace the date in
>
> On Mon, Sep 13, 2021 at 03:49:05PM +0200, Maxime Devos wrote:
>> https://web.archive.org/web/20161204140455/https://www.astromatic.net/download/stuff/stuff-1.26.0.tar.gz
>
> by the current time.

Oh nice, that seems to work:

--8<---------------cut here---------------start------------->8---
$ guix download https://web.archive.org/web/20210911171400/https://www.astromatic.net/download/stuff/stuff-1.26.0.tar.gz

Starting download of /tmp/guix-file.QXTq4V
From https://web.archive.org/web/20210911171400/https://www.astromatic.net/download/stuff/stuff-1.26.0.tar.gz...
following redirection to `https://web.archive.org/web/20161204140455/http://www.astromatic.net/download/stuff/stuff-1.26.0.tar.gz'...
 …6.0.tar.gz                                                                        200KiB/s 00:20 | 3.9MiB transferred
/gnu/store/l3r5j8r4f6fh6bxa9va3681n3bclxpdq-stuff-1.26.0.tar.gz
1syibi3b86z9pikhicvkkmgxm916j732fdiw0agw0lq6z13fdcjm
--8<---------------cut here---------------end--------------->8---

How ’bout the attached patch?  Works for me.

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1444 bytes --]

diff --git a/guix/build/download.scm b/guix/build/download.scm
index c8ddadfdd4..140e42afec 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -678,6 +678,18 @@ and write the output to FILE."
                (false-if-exception*
                 (disarchive-assemble spec file #:resolver resolve))))))))
 
+(define (internet-archive-uri uri)
+  "Return a URI corresponding to an Internet Archive backup of URI, or #f if
+URI does not denote a Web URI."
+  (and (memq (uri-scheme uri) '(http https))
+       (let* ((now  (time-utc->date (current-time time-utc)))
+              (date (date->string now "~Y~m~d~H~M~S")))
+         ;; Note: the date in the URL can be anything and web.archive.org
+         ;; automatically redirects to the closest date.
+         (build-uri 'https #:host "web.archive.org"
+                    #:path (string-append "/web/" date "/"
+                                          (uri->string uri))))))
+
 (define* (url-fetch url file
                     #:key
                     (timeout 10) (verify-certificate? #t)
@@ -769,7 +781,9 @@ otherwise simply ignore them."
 
   (setvbuf (current-error-port) 'line)
 
-  (let try ((uri (append uri content-addressed-uris)))
+  (let try ((uri (append uri content-addressed-uris
+                   (or (and=> (internet-archive-uri (first uri)) list)
+                       '()))))
     (match uri
       ((uri tail ...)
        (or (fetch uri file)

  reply	other threads:[~2021-09-16 19:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 13:16 bug#50568: Missing source code Ludovic Courtès
2021-09-13 13:49 ` Maxime Devos
2021-09-14  8:38   ` Ludovic Courtès
2021-09-14  8:54     ` zimoun
2021-09-16 19:28       ` Ludovic Courtès
2021-09-17 10:10         ` zimoun
2021-09-14  9:36     ` pelzflorian (Florian Pelz)
2021-09-16 19:45       ` Ludovic Courtès [this message]
2021-09-17 10:46         ` pelzflorian (Florian Pelz)
2021-09-20  7:25           ` Ludovic Courtès
2021-09-21 10:28             ` pelzflorian (Florian Pelz)
2021-09-21 16:34               ` pelzflorian (Florian Pelz)
2021-09-22  9:37               ` Ludovic Courtès
2021-09-13 13:49 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2021-09-13 14:30   ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2021-09-14  8:40     ` Ludovic Courtès
2021-10-04 20:05 ` Ludovic Courtès
2021-10-05 14:16   ` Guillaume Le Vaillant
2021-10-07 13:38     ` Ludovic Courtès
2021-10-07 13:53   ` Ludovic Courtès
2021-10-07 15:17     ` Maxime Devos
2021-10-07 17:01       ` Ludovic Courtès
2021-10-11  9:55     ` zimoun
2021-10-12  9:50       ` Ludovic Courtès
2021-10-12 11:08         ` zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735q41ezt.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=50568@debbugs.gnu.org \
    --cc=pelzflorian@pelzflorian.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.