summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-03-15 15:17:49 +0100
committerLudovic Courtès <ludo@gnu.org>2022-03-16 15:48:51 +0100
commit00dfff84c66c5c6aa4853684419a92befe55d4b4 (patch)
treef4a565586e1f06f9df8bd78e86302bd5a98b05c9 /tests
parente3801126a9566bc89c3746a54128609ad6eff1fd (diff)
downloadguix-00dfff84c66c5c6aa4853684419a92befe55d4b4.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/packages.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index 2cb90d3145..710eace6dc 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -1982,6 +1982,21 @@
       ((("coreutils" input "out"))
        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")
 
 ;;; Local Variables: