aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-12-21 23:46:44 +0100
committerLudovic Courtès <ludo@gnu.org>2016-12-21 23:48:14 +0100
commit7c247809efe5d6a2a11617f41f45a2b6e8d6855f (patch)
treecd00d39ef9ee9c9bf95f80583e76e0fd431d3969 /tests
parent590b80d29a359d6dbaa3e1f5861e38572e077317 (diff)
downloadguix-7c247809efe5d6a2a11617f41f45a2b6e8d6855f.tar
guix-7c247809efe5d6a2a11617f41f45a2b6e8d6855f.tar.gz
guix build: '--with-source' overrides the 'replacement' of a package.
* guix/scripts/build.scm (package-with-source): Set 'replacement' to #f. * tests/scripts-build.scm ("options->transformation, with-source, replacement"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/scripts-build.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/scripts-build.scm b/tests/scripts-build.scm
index b324012806..a1f684c736 100644
--- a/tests/scripts-build.scm
+++ b/tests/scripts-build.scm
@@ -50,6 +50,19 @@
(add-to-store store "guix.scm" #t
"sha256" s)))))))
+(test-assert "options->transformation, with-source, replacement"
+ ;; Same, but this time the original package has a 'replacement' field. We
+ ;; expect that replacement to be set to #f in the new package.
+ (let* ((p (dummy-package "guix.scm" (replacement coreutils)))
+ (s (search-path %load-path "guix.scm"))
+ (t (options->transformation `((with-source . ,s)))))
+ (with-store store
+ (let ((new (t store p)))
+ (and (not (eq? new p))
+ (string=? (package-source new)
+ (add-to-store store "guix.scm" #t "sha256" s))
+ (not (package-replacement new)))))))
+
(test-assert "options->transformation, with-source, with version"
;; Our pseudo-package is called 'guix.scm' so the 'guix.scm-2.0' source
;; should be applicable, and its version should be extracted.