mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 21:59:08 -05:00
store: 'path-info-deriver' is #f when there is no deriver.
* guix/store.scm (read-path-info): Use #f when we get the empty string for DERIVER. * guix/scripts/publish.scm (narinfo-string): Adjust accordingly. * tests/store.scm ("path-info-deriver"): New test.
This commit is contained in:
parent
acb01e3746
commit
22572d56cb
3 changed files with 20 additions and 3 deletions
|
@ -164,7 +164,7 @@ (define (narinfo-string store store-path key)
|
||||||
store-path url hash size references))
|
store-path url hash size references))
|
||||||
;; Do not render a "Deriver" or "System" line if we are rendering
|
;; Do not render a "Deriver" or "System" line if we are rendering
|
||||||
;; info for a derivation.
|
;; info for a derivation.
|
||||||
(info (if (string-null? deriver)
|
(info (if (not deriver)
|
||||||
base-info
|
base-info
|
||||||
(catch 'system-error
|
(catch 'system-error
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
|
|
@ -242,14 +242,16 @@ (define (read-substitutable-path-list p)
|
||||||
(define-record-type <path-info>
|
(define-record-type <path-info>
|
||||||
(path-info deriver hash references registration-time nar-size)
|
(path-info deriver hash references registration-time nar-size)
|
||||||
path-info?
|
path-info?
|
||||||
(deriver path-info-deriver)
|
(deriver path-info-deriver) ;string | #f
|
||||||
(hash path-info-hash)
|
(hash path-info-hash)
|
||||||
(references path-info-references)
|
(references path-info-references)
|
||||||
(registration-time path-info-registration-time)
|
(registration-time path-info-registration-time)
|
||||||
(nar-size path-info-nar-size))
|
(nar-size path-info-nar-size))
|
||||||
|
|
||||||
(define (read-path-info p)
|
(define (read-path-info p)
|
||||||
(let ((deriver (read-store-path p))
|
(let ((deriver (match (read-store-path p)
|
||||||
|
("" #f)
|
||||||
|
(x x)))
|
||||||
(hash (base16-string->bytevector (read-string p)))
|
(hash (base16-string->bytevector (read-string p)))
|
||||||
(refs (read-store-path-list p))
|
(refs (read-store-path-list p))
|
||||||
(registration-time (read-int p))
|
(registration-time (read-int p))
|
||||||
|
|
|
@ -856,6 +856,21 @@ (define ref-hash
|
||||||
(string->utf8
|
(string->utf8
|
||||||
(call-with-output-string (cut write-file item <>))))))))
|
(call-with-output-string (cut write-file item <>))))))))
|
||||||
|
|
||||||
|
(test-assert "path-info-deriver"
|
||||||
|
(let* ((b (add-text-to-store %store "build" "echo $foo > $out" '()))
|
||||||
|
(s (add-to-store %store "bash" #t "sha256"
|
||||||
|
(search-bootstrap-binary "bash"
|
||||||
|
(%current-system))))
|
||||||
|
(d (derivation %store "the-thing"
|
||||||
|
s `("-e" ,b)
|
||||||
|
#:env-vars `(("foo" . ,(random-text)))
|
||||||
|
#:inputs `((,b) (,s))))
|
||||||
|
(o (derivation->output-path d)))
|
||||||
|
(and (build-derivations %store (list d))
|
||||||
|
(not (path-info-deriver (query-path-info %store b)))
|
||||||
|
(string=? (derivation-file-name d)
|
||||||
|
(path-info-deriver (query-path-info %store o))))))
|
||||||
|
|
||||||
(test-end "store")
|
(test-end "store")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue