[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/14: import: elpa: Also check NonGNU ELPA for updates.
From: |
guix-commits |
Subject: |
06/14: import: elpa: Also check NonGNU ELPA for updates. |
Date: |
Wed, 5 Jan 2022 17:46:34 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 82eb05c3983f2fc3c69ed4190f05da72adf39bf8
Author: Xinglu Chen <public@yoctocell.xyz>
AuthorDate: Thu Dec 23 22:08:33 2021 +0100
import: elpa: Also check NonGNU ELPA for updates.
* guix/import/elpa.scm (latest-release): Determine the repository based
on the URL of the source.
(package-from-gnu.org?): Rename to ...
(elpa-repository): ...this; memoize.
(package-from-elpa-repository?): New procedure.
(%elpa-updater): Adjust accordingly.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
guix/import/elpa.scm | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index edabb88b7a..5a092ebdc2 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -44,6 +44,7 @@
#:use-module (guix base32)
#:use-module (guix upstream)
#:use-module (guix packages)
+ #:use-module (guix memoization)
#:use-module ((guix utils) #:select (call-with-temporary-output-file))
#:export (elpa->guix-package
guix-package->elpa-name
@@ -424,7 +425,7 @@ type '<elpa-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 (elpa-repository package))
(match (elpa-package-info name repo)
(#f
@@ -443,11 +444,20 @@ type '<elpa-package>'."
(urls (list url))
(signature-urls (list (string-append url ".sig"))))))))
-(define package-from-gnu.org?
- (url-predicate (lambda (url)
- (let ((uri (string->uri url)))
- (and uri
- (string=? (uri-host uri) "elpa.gnu.org"))))))
+(define elpa-repository
+ (memoize
+ (url-predicate (lambda (url)
+ (let ((uri (string->uri url)))
+ (and uri
+ (cond
+ ((string=? (uri-host uri) "elpa.gnu.org")
+ 'gnu)
+ ((string=? (uri-host uri) "elpa.nongnu.org")
+ 'nongnu)
+ (else #f))))))))
+
+(define (package-from-elpa-repository? package)
+ (member (elpa-repository package) '(gnu nongnu)))
(define %elpa-updater
;; The ELPA updater. We restrict it to packages hosted on elpa.gnu.org
@@ -455,7 +465,7 @@ type '<elpa-package>'."
(upstream-updater
(name 'elpa)
(description "Updater for ELPA packages")
- (pred package-from-gnu.org?)
+ (pred package-from-elpa-repository?)
(latest latest-release)))
(define elpa-guix-name (cut guix-name "emacs-" <>))
- branch master updated (2c1807c516 -> 9765768950), guix-commits, 2022/01/05
- 01/14: linux-container: Handle CLONE_NEWCGROUP and use it by default., guix-commits, 2022/01/05
- 03/14: gnu: tootle: Simplify inputs., guix-commits, 2022/01/05
- 06/14: import: elpa: Also check NonGNU ELPA for updates.,
guix-commits <=
- 02/14: gnu: tootle: Fix build., guix-commits, 2022/01/05
- 07/14: gnu: guile-udev: Update to 0.2.3, guix-commits, 2022/01/05
- 04/14: gnu: tootle: Remove trailing #t in phases., guix-commits, 2022/01/05
- 05/14: home: import: Fix handling of manifest entries with specific output., guix-commits, 2022/01/05
- 08/14: gnu: minetest-basic-materials: Update to 2021-12-26., guix-commits, 2022/01/05
- 09/14: gnu: minetest-homedecor-modpack: Update to 2021-12-26., guix-commits, 2022/01/05
- 10/14: gnu: minetest-mobs: Update to 2021-12-12., guix-commits, 2022/01/05
- 11/14: gnu: minetest-mobs-animal: Update to 2021-11-14., guix-commits, 2022/01/05
- 13/14: gnu: minetest-unified-inventory: Update to 2021-12-26., guix-commits, 2022/01/05
- 14/14: gnu: go-github-com-hashicorp-hcl: Update to 1.0.0., guix-commits, 2022/01/05