mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
derivations: Fix 'fixed-output-derivation?'.
Reported by Nikita Karetnikov <nikita@karetnikov.org>. * guix/derivations.scm (fixed-output-derivation?): Fix pattern. * tests/derivations.scm ("fixed-output-derivation?"): Add test.
This commit is contained in:
parent
c5cd288bc7
commit
99e17dc927
2 changed files with 11 additions and 1 deletions
|
@ -121,7 +121,7 @@ (define (fixed-output-derivation? drv)
|
|||
download with a fixed hash (aka. `fetchurl')."
|
||||
(match drv
|
||||
(($ <derivation>
|
||||
(($ <derivation-output> _ (? symbol?) (? string?))))
|
||||
(("out" . ($ <derivation-output> _ (? symbol?) (? bytevector?)))))
|
||||
#t)
|
||||
(_ #f)))
|
||||
|
||||
|
|
|
@ -159,6 +159,16 @@ (define prefix-len (string-length dir))
|
|||
;; the contents.
|
||||
(valid-path? %store (derivation->output-path drv)))))
|
||||
|
||||
(test-assert "fixed-output-derivation?"
|
||||
(let* ((builder (add-text-to-store %store "my-fixed-builder.sh"
|
||||
"echo -n hello > $out" '()))
|
||||
(hash (sha256 (string->utf8 "hello")))
|
||||
(drv (derivation %store "fixed"
|
||||
%bash `(,builder)
|
||||
#:inputs `((,builder))
|
||||
#:hash hash #:hash-algo 'sha256)))
|
||||
(fixed-output-derivation? drv)))
|
||||
|
||||
(test-assert "fixed-output derivation"
|
||||
(let* ((builder (add-text-to-store %store "my-fixed-builder.sh"
|
||||
"echo -n hello > $out" '()))
|
||||
|
|
Loading…
Reference in a new issue