From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZjhC-0008AJ-Pc for guix-patches@gnu.org; Wed, 19 Dec 2018 16:48:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZjhB-0004EE-S4 for guix-patches@gnu.org; Wed, 19 Dec 2018 16:48:02 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:50912) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZjhB-0004Dz-Mk for guix-patches@gnu.org; Wed, 19 Dec 2018 16:48:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gZjhB-0004iU-Jv for guix-patches@gnu.org; Wed, 19 Dec 2018 16:48:01 -0500 Subject: [bug#33801] import: github: Support source URIs that redirect to GitHub Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Wed, 19 Dec 2018 22:47:00 +0100 In-Reply-To: (Arun Isaac's message of "Wed, 19 Dec 2018 16:14:20 +0530") Message-ID: <87d0pxtciz.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Arun Isaac Cc: 33801@debbugs.gnu.org Hi, Arun Isaac skribis: > Many GitHub hosted packages (for example, youtube-dl) present source > tarballs for download on their website > (https://yt-dl.org/downloads/latest/youtube-dl-2018.12.17.tar.gz). But > these URIs just redirect to GitHub. Currently, our GitHub refresher > does not cover these packages. This patch addresses that. Good idea! Do you know how many packages fall into that category? > From 90f756fd6f7df50236023e120cb040f6e5d1718c Mon Sep 17 00:00:00 2001 > From: Arun Isaac > Date: Wed, 19 Dec 2018 15:59:52 +0530 > Subject: [PATCH] import: github: Support source URIs that redirect to Git= Hub. > > * guix/import/github.scm (follow-redirects-to-github): New function. > (updated-github-url)[updated-url]: For source URIs on other domains, repl= ace > all instances of the old version with the new version. > (latest-release)[origin-github-uri]: If necessary, follow redirects to fi= nd > the GitHub URI. [...] > +(define (follow-redirects-to-github uri) > + "Follow redirects of URI until a GitHub URI is found. Return that GitH= ub > +URI. If no GitHub URI is found, return #f." Perhaps add the yt-dl.org example as a comment here. > + (define (follow-redirect uri) > + (receive (response body) (http-get uri #:streaming? #t) Add: (close-port body). Otherwise LGTM, thanks! Ludo=E2=80=99.