From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:44481) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izFRj-00046T-Vg for guix-patches@gnu.org; Wed, 05 Feb 2020 02:50:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izFRi-0003Hr-MW for guix-patches@gnu.org; Wed, 05 Feb 2020 02:50:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39101) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1izFRi-0003Hg-Ig for guix-patches@gnu.org; Wed, 05 Feb 2020 02:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1izFRi-0003aj-Fg for guix-patches@gnu.org; Wed, 05 Feb 2020 02:50:02 -0500 Subject: [bug#39430] Use =?UTF-8?Q?CRAN=E2=80=99s?= canonical URL as home-page Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:44456) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izFRK-00043p-HO for guix-patches@gnu.org; Wed, 05 Feb 2020 02:49:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izFRI-0002nP-P7 for guix-patches@gnu.org; Wed, 05 Feb 2020 02:49:38 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:35477) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1izFRI-0002lw-Cv for guix-patches@gnu.org; Wed, 05 Feb 2020 02:49:36 -0500 Received: by mail-wr1-x42e.google.com with SMTP id w12so1416472wrt.2 for ; Tue, 04 Feb 2020 23:49:36 -0800 (PST) Received: from localhost (zpidlx9.uni-trier.de. [136.199.85.49]) by smtp.gmail.com with ESMTPSA id k8sm25563367wrq.67.2020.02.04.23.49.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 23:49:34 -0800 (PST) Date: Wed, 5 Feb 2020 08:49:33 +0100 From: Lars-Dominik Braun Message-ID: <20200205074933.GH2917@zpidnp36> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tsOsTdHNUZQcU9Ye" Content-Disposition: inline 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: 39430@debbugs.gnu.org --tsOsTdHNUZQcU9Ye Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I noticed for packages not specifying any URL the CRAN importer emits home-page URLs like https://cran.r-project.org/web/packages/ (without trailing slash). These are permanent redirects, thus the linter complains about them. One option would be adding a trailing slash or use the canonical URL, as provided by CRAN (on the bottom of the description page). The attached patch does the latter. Lars --tsOsTdHNUZQcU9Ye Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-import-cran-Use-CRAN-s-canonical-URL-as-home-page.patch" >From 01a43735fe5b2ee5c34431d9e5109e3718e7612b Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Wed, 5 Feb 2020 08:26:08 +0100 Subject: [PATCH] =?UTF-8?q?import:=20cran:=20Use=20CRAN=E2=80=99s=20canoni?= =?UTF-8?q?cal=20URL=20as=20home-page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/import/cran.scm (%cran-canonical-url): New variable. (description->package): Construct home-page using canonical URL. --- guix/import/cran.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index bcb37ed250..9f1214324c 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -134,6 +134,7 @@ package definition." `((,type (,'quasiquote ,(format-inputs package-inputs))))))) (define %cran-url "https://cran.r-project.org/web/packages/") +(define %cran-canonical-url "https://cran.r-project.org/package=") (define %bioconductor-url "https://bioconductor.org/packages/") ;; The latest Bioconductor release is 3.10. Bioconductor packages should be @@ -402,6 +403,10 @@ from the alist META, which was derived from the R package's DESCRIPTION file." ((cran) %cran-url) ((bioconductor) %bioconductor-url) ((git) #f))) + (canonical-url (case repository + ((cran) %cran-canonical-url) + ((bioconductor) %bioconductor-url) + ((git) #f))) (uri-helper (case repository ((cran) cran-uri) ((bioconductor) bioconductor-uri) @@ -415,7 +420,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file." ((git) (assoc-ref meta 'git)) (else (match (listify meta "URL") ((url rest ...) url) - (_ (string-append base-url name)))))) + (_ (string-append canonical-url name)))))) (source-url (case repository ((git) (assoc-ref meta 'git)) (else -- 2.20.1 --tsOsTdHNUZQcU9Ye--