mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
packages: 'modify-inputs' preserves outputs in 'replace' clauses.
Fixes <https://issues.guix.gnu.org/53915>. Reported by Gordon Quad <gordon@niflheim.info>. * guix/packages.scm (replace-input): Preserve the outputs of INPUT by default. * tests/packages.scm ("modify-inputs, replace, extra output"): New test.
This commit is contained in:
parent
e3801126a9
commit
00dfff84c6
2 changed files with 17 additions and 2 deletions
|
@ -1091,11 +1091,11 @@ (define (replace-input name replacement inputs)
|
||||||
"Replace input NAME by REPLACEMENT within INPUTS."
|
"Replace input NAME by REPLACEMENT within INPUTS."
|
||||||
(map (lambda (input)
|
(map (lambda (input)
|
||||||
(match input
|
(match input
|
||||||
(((? string? label) . _)
|
(((? string? label) _ . outputs)
|
||||||
(if (string=? label name)
|
(if (string=? label name)
|
||||||
(match replacement ;does REPLACEMENT specify an output?
|
(match replacement ;does REPLACEMENT specify an output?
|
||||||
((_ _) (cons label replacement))
|
((_ _) (cons label replacement))
|
||||||
(_ (list label replacement)))
|
(_ (cons* label replacement outputs)))
|
||||||
input))))
|
input))))
|
||||||
inputs))
|
inputs))
|
||||||
|
|
||||||
|
|
|
@ -1982,6 +1982,21 @@ (define (list->set* lst)
|
||||||
((("coreutils" input "out"))
|
((("coreutils" input "out"))
|
||||||
input))))
|
input))))
|
||||||
|
|
||||||
|
(test-eq "modify-inputs, replace, extra output"
|
||||||
|
guile-3.0
|
||||||
|
;; Replace an input; notice that its output is preserved.
|
||||||
|
;; See <https://issues.guix.gnu.org/53915>.
|
||||||
|
(let* ((p1 (dummy-package "p"
|
||||||
|
(inputs (list `(,coreutils "debug")))))
|
||||||
|
(p2 (package
|
||||||
|
(inherit p1)
|
||||||
|
(version "1")
|
||||||
|
(inputs (modify-inputs (package-inputs p1)
|
||||||
|
(replace "coreutils" guile-3.0))))))
|
||||||
|
(match (package-inputs p2)
|
||||||
|
((("coreutils" input "debug"))
|
||||||
|
input))))
|
||||||
|
|
||||||
(test-end "packages")
|
(test-end "packages")
|
||||||
|
|
||||||
;;; Local Variables:
|
;;; Local Variables:
|
||||||
|
|
Loading…
Reference in a new issue