GNU bug report logs - #52774
[PATCH] import: elpa: Also check NonGNU ELPA for updates.

Previous Next

Package: guix-patches;

Reported by: Xinglu Chen <public <at> yoctocell.xyz>

Date: Fri, 24 Dec 2021 11:26:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#52774: closed ([PATCH] import: elpa: Also check NonGNU ELPA
 for updates.)
Date: Wed, 05 Jan 2022 22:19:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 05 Jan 2022 23:18:06 +0100
with message-id <875yqxj081.fsf_-_ <at> gnu.org>
and subject line Re: bug#52774: [PATCH] import: elpa: Also check NonGNU ELPA for updates.
has caused the debbugs.gnu.org bug report #52774,
regarding [PATCH] import: elpa: Also check NonGNU ELPA for updates.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
52774: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52774
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Xinglu Chen <public <at> yoctocell.xyz>
To: guix-patches <at> gnu.org
Subject: [PATCH] import: elpa: Also check NonGNU ELPA for updates.
Date: Fri, 24 Dec 2021 12:25:21 +0100
* elpa.scm (latest-release): Determine the repository based on the URL of the
source.
(package-from-gnu.org?): Rename to ...
(package-from-gnu.org-or-nongnu.org?): ...this.
(%elpa-updater): Adjust accordingly.
---
 guix/import/elpa.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index edabb88b7a..038379e01b 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -424,7 +424,11 @@ (define (guix-package->elpa-name package)
 (define (latest-release package)
   "Return an <upstream-release> for the latest release of PACKAGE."
   (define name (guix-package->elpa-name package))
-  (define repo 'gnu)
+  (define repo
+    (let ((url (origin-uri (package-source package))))
+      (if (string-prefix? "https://elpa.nongnu.org" url)
+          'nongnu
+          'gnu)))
 
   (match (elpa-package-info name repo)
     (#f
@@ -443,11 +447,12 @@ (define repo 'gnu)
         (urls (list url))
         (signature-urls (list (string-append url ".sig"))))))))
 
-(define package-from-gnu.org?
+(define package-from-gnu.org-or-nongnu.org?
   (url-predicate (lambda (url)
                    (let ((uri (string->uri url)))
                      (and uri
-                          (string=? (uri-host uri) "elpa.gnu.org"))))))
+                          (or (string=? (uri-host uri) "elpa.gnu.org")
+                              (string=? (uri-host uri) "elpa.nongnu.org")))))))
 
 (define %elpa-updater
   ;; The ELPA updater.  We restrict it to packages hosted on elpa.gnu.org
@@ -455,7 +460,7 @@ (define %elpa-updater
   (upstream-updater
    (name 'elpa)
    (description "Updater for ELPA packages")
-   (pred package-from-gnu.org?)
+   (pred package-from-gnu.org-or-nongnu.org?)
    (latest latest-release)))
 
 (define elpa-guix-name (cut guix-name "emacs-" <>))

base-commit: e8c1562599c7ebee8b7b228237fb0d75d4472a61
-- 
2.33.1





[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Xinglu Chen <public <at> yoctocell.xyz>
Cc: Liliana Marie Prikler <liliana.prikler <at> gmail.com>,
 52774-done <at> debbugs.gnu.org
Subject: Re: bug#52774: [PATCH] import: elpa: Also check NonGNU ELPA for
 updates.
Date: Wed, 05 Jan 2022 23:18:06 +0100
Hi,

Xinglu Chen <public <at> yoctocell.xyz> skribis:

> From 4332502000bd06a2be900c236666d10f07777807 Mon Sep 17 00:00:00 2001
> Message-Id: <4332502000bd06a2be900c236666d10f07777807.1640522590.git.public <at> yoctocell.xyz>
> From: Xinglu Chen <public <at> yoctocell.xyz>
> Date: Thu, 23 Dec 2021 22:08:33 +0100
> Subject: [PATCH] import: elpa: Also check NonGNU ELPA for updates.
>
> * elpa.scm (latest-release): Determine the repository based on the URL of the
> source.
> (package-from-gnu.org?): Rename to ...
> (elpa-repository): ...this; memoize.
> (elpa-package?): New procedure.
> (%elpa-updater): Adjust accordingly.

Applied, thanks to the two of you!

I had to rename ‘elpa-package?’ because:

  guix/import/elpa.scm:459:0: warning: shadows previous definition of `elpa-package?' at <unknown-location>

(The other ‘elpa-package?’ predicate wasn’t used, but still.)

Ludo’.


This bug report was last modified 3 years and 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.