mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
packages: Suitably cope with indirect store paths as package sources.
* guix/packages.scm (package-source-derivation): Don't let indirect store paths pass through. * tests/packages.scm ("package-source-derivation, indirect store path"): New test.
This commit is contained in:
parent
9336e5b5e7
commit
f80594cc41
2 changed files with 12 additions and 1 deletions
|
@ -413,7 +413,7 @@ (define* (package-source-derivation store source
|
||||||
#:guile-for-build (or guile-for-build
|
#:guile-for-build (or guile-for-build
|
||||||
(%guile-for-build)
|
(%guile-for-build)
|
||||||
(default-guile store system)))))
|
(default-guile store system)))))
|
||||||
((and (? string?) (? store-path?) file)
|
((and (? string?) (? direct-store-path?) file)
|
||||||
file)
|
file)
|
||||||
((? string? file)
|
((? string? file)
|
||||||
(add-to-store store (basename file) #t "sha256" file))))
|
(add-to-store store (basename file) #t "sha256" file))))
|
||||||
|
|
|
@ -122,6 +122,17 @@ (define read-at
|
||||||
(package-source package))))
|
(package-source package))))
|
||||||
(string=? file source)))
|
(string=? file source)))
|
||||||
|
|
||||||
|
(test-assert "package-source-derivation, indirect store path"
|
||||||
|
(let* ((dir (add-to-store %store "guix-build" #t "sha256"
|
||||||
|
(dirname (search-path %load-path
|
||||||
|
"guix/build/utils.scm"))))
|
||||||
|
(package (package (inherit (dummy-package "p"))
|
||||||
|
(source (string-append dir "/utils.scm"))))
|
||||||
|
(source (package-source-derivation %store
|
||||||
|
(package-source package))))
|
||||||
|
(and (direct-store-path? source)
|
||||||
|
(string-suffix? "utils.scm" source))))
|
||||||
|
|
||||||
(test-equal "package-source-derivation, snippet"
|
(test-equal "package-source-derivation, snippet"
|
||||||
"OK"
|
"OK"
|
||||||
(let* ((file (search-bootstrap-binary "guile-2.0.7.tar.xz"
|
(let* ((file (search-bootstrap-binary "guile-2.0.7.tar.xz"
|
||||||
|
|
Loading…
Reference in a new issue