aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-03-02 23:57:23 +0100
committerLudovic Courtès <ludo@gnu.org>2016-03-03 00:18:30 +0100
commit94d609aba8e14963459c21863ab56da2b5f01517 (patch)
tree8f98c0f83bd4fc2c42d387685fa7751e96adf4dc /guix
parent49c4fd2aab0c99c32ec338949ff07bd89d2920f6 (diff)
downloadgnu-guix-94d609aba8e14963459c21863ab56da2b5f01517.tar
gnu-guix-94d609aba8e14963459c21863ab56da2b5f01517.tar.gz
guix build: -S returns the replacement's source.
Reported by Mark H Weaver. * guix/scripts/build.scm (options->derivations): When SRC and GRAFT? are true, use the source of P's replacement. * tests/guix-build.sh: Add test.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/build.scm19
1 files changed, 10 insertions, 9 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index d6bb35c99a..a8becea2de 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -592,15 +592,16 @@ build."
(parameterize ((%graft? graft?))
(append-map (match-lambda
((? package? p)
- (match src
- (#f
- (list (package->derivation store p system)))
- (#t
- (let ((s (package-source p)))
- (list (package-source-derivation store s))))
- (proc
- (map (cut package-source-derivation store <>)
- (proc p)))))
+ (let ((p (or (and graft? (package-replacement p)) p)))
+ (match src
+ (#f
+ (list (package->derivation store p system)))
+ (#t
+ (let ((s (package-source p)))
+ (list (package-source-derivation store s))))
+ (proc
+ (map (cut package-source-derivation store <>)
+ (proc p))))))
((? derivation? drv)
(list drv))
((? procedure? proc)