diff options
author | Xinglu Chen <public@yoctocell.xyz> | 2021-12-17 21:55:54 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-12-18 22:51:55 +0100 |
commit | f21c70bc9a41d000acf7d39a0813a3c7415517ca (patch) | |
tree | 702facf91a33789ab228914437f37dce1701c7ab /guix/import | |
parent | 08b0f5c2a55fb06df8b5594ccbddaf3b01f9f8d4 (diff) |
import: elpa: Support ‘upstream-name’ property.
* guix/import/elpa.scm: (guix-package->elpa-name): New procedure.
(latest-release): Use it.
* tests/elpa.scm ("guix-package->elpa-name: without 'upstream-name' property")
("guix-package->elpa-name: with 'upstream-name' property"): Test it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'guix/import')
-rw-r--r-- | guix/import/elpa.scm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index dd539cd945..edabb88b7a 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -46,6 +46,7 @@ #:use-module (guix packages) #:use-module ((guix utils) #:select (call-with-temporary-output-file)) #:export (elpa->guix-package + guix-package->elpa-name %elpa-updater elpa-recursive-import)) @@ -412,13 +413,17 @@ type '<elpa-package>'." ;;; Updates. ;;; +(define (guix-package->elpa-name package) + "Given a Guix package, PACKAGE, return the upstream name on ELPA." + (or (and=> (package-properties package) + (cut assq-ref <> 'upstream-name)) + (if (string-prefix? "emacs-" (package-name package)) + (string-drop (package-name package) 6) + (package-name package)))) + (define (latest-release package) "Return an <upstream-release> for the latest release of PACKAGE." - (define name - (if (string-prefix? "emacs-" (package-name package)) - (string-drop (package-name package) 6) - (package-name package))) - + (define name (guix-package->elpa-name package)) (define repo 'gnu) (match (elpa-package-info name repo) |