summaryrefslogtreecommitdiff
path: root/guix/import/utils.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2023-01-03 15:38:13 +0100
committerMarius Bakke <marius@gnu.org>2023-01-03 15:38:13 +0100
commit9123bb0fba3fce976dc41cd3b8919ee73b4cee4d (patch)
tree50ba63a4a3a6ffeb2f37fd0929813b51e00d01dc /guix/import/utils.scm
parentec0fbb471dfc6f72796da9ebafbb0630daa91267 (diff)
parent71ee1fbbed8ea9788dd48a634653d66606d372ce (diff)
Merge branch 'master' into staging
Diffstat (limited to 'guix/import/utils.scm')
-rw-r--r--guix/import/utils.scm15
1 files changed, 9 insertions, 6 deletions
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index d6b179b57c..41311cb86e 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -580,11 +580,11 @@ obtain a node's uniquely identifying \"key\"."
(set-insert (node-name head) visited))))))))
(define* (recursive-import package-name
- #:key repo->guix-package guix-name version repo
- #:allow-other-keys)
+ #:key repo->guix-package guix-name version
+ #:allow-other-keys #:rest rest)
"Return a list of package expressions for PACKAGE-NAME and all its
dependencies, sorted in topological order. For each package,
-call (REPO->GUIX-PACKAGE NAME :KEYS version repo), which should return a
+call (REPO->GUIX-PACKAGE NAME :KEYS version), which should return a
package expression and a list of dependencies; call (GUIX-NAME PACKAGE-NAME)
to obtain the Guix package name corresponding to the upstream name."
(define-record-type <node>
@@ -599,9 +599,12 @@ to obtain the Guix package name corresponding to the upstream name."
(not (null? (find-packages-by-name (guix-name name) version))))
(define (lookup-node name version)
- (let* ((package dependencies (repo->guix-package name
- #:version version
- #:repo repo))
+ (let* ((pre post (break (cut eq? #:version <>) rest))
+ (post* (match post
+ ((#:version v . more) more)
+ (_ post)))
+ (args (append pre (list #:version version) post*))
+ (package dependencies (apply repo->guix-package (cons* name args)))
(normalized-deps (map (match-lambda
((name version) (list name version))
(name (list name #f))) dependencies)))