mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
import: utils: Skip not found packages.
* guix/import/utils.scm (recursive-import): Skip packages when the package returned by 'repo->guix-package' is false. * tests/import-utils.scm: New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
16579a7c57
commit
f95bdeb93a
2 changed files with 42 additions and 12 deletions
|
@ -8,6 +8,7 @@
|
|||
;;; Copyright © 2020 Helio Machado <0x2b3bfa0+guix@googlemail.com>
|
||||
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
|
||||
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -489,7 +490,8 @@ (define (lookup-node name version)
|
|||
(name (list name #f))) dependencies)))
|
||||
(make-node name version package normalized-deps)))
|
||||
|
||||
(map node-package
|
||||
(filter-map
|
||||
node-package
|
||||
(topological-sort (list (lookup-node package-name version))
|
||||
(lambda (node)
|
||||
(map (lambda (name-version)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
|
||||
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
|
||||
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -64,6 +65,33 @@ (define-module (test-import-utils)
|
|||
'())))
|
||||
#:guix-name identity))
|
||||
|
||||
(test-equal "recursive-import: skip false packages (toplevel)"
|
||||
'()
|
||||
(recursive-import "foo"
|
||||
#:repo 'repo
|
||||
#:repo->guix-package
|
||||
(match-lambda*
|
||||
(("foo" #:version #f #:repo 'repo)
|
||||
(values #f '())))
|
||||
#:guix-name identity))
|
||||
|
||||
(test-equal "recursive-import: skip false packages (dependency)"
|
||||
'((package
|
||||
(name "foo")
|
||||
(inputs `(("bar" ,bar)))))
|
||||
(recursive-import "foo"
|
||||
#:repo 'repo
|
||||
#:repo->guix-package
|
||||
(match-lambda*
|
||||
(("foo" #:version #f #:repo 'repo)
|
||||
(values '(package
|
||||
(name "foo")
|
||||
(inputs `(("bar" ,bar))))
|
||||
'("bar")))
|
||||
(("bar" #:version #f #:repo 'repo)
|
||||
(values #f '())))
|
||||
#:guix-name identity))
|
||||
|
||||
(test-assert "alist->package with simple source"
|
||||
(let* ((meta '(("name" . "hello")
|
||||
("version" . "2.10")
|
||||
|
|
Loading…
Reference in a new issue