mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-23 21:17:11 -05:00
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.
This commit is contained in:
parent
590b80d29a
commit
7c247809ef
2 changed files with 18 additions and 1 deletions
|
@ -151,7 +151,11 @@ (define (tarball-base-name file-name)
|
|||
|
||||
;; Use #:recursive? #t to allow for directories.
|
||||
(source (download-to-store store uri
|
||||
#:recursive? #t))))))
|
||||
#:recursive? #t))
|
||||
|
||||
;; Override the replacement, otherwise '--with-source' would
|
||||
;; have no effect.
|
||||
(replacement #f)))))
|
||||
|
||||
|
||||
;;;
|
||||
|
|
|
@ -50,6 +50,19 @@ (define-module (test-scripts-build)
|
|||
(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.
|
||||
|
|
Loading…
Reference in a new issue