summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-02-26 23:14:28 +0100
committerLudovic Courtès <ludo@gnu.org>2016-02-26 23:35:29 +0100
commit22572d56cb3da5b176b5b5697d4e8e71067eab74 (patch)
treeef1cdb100716ff5d58c9ae6f75db4e198fd647ba /tests
parentacb01e37466a1d3fff81f10e00fe15a4ef20e2db (diff)
downloadguix-22572d56cb3da5b176b5b5697d4e8e71067eab74.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/store.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/store.scm b/tests/store.scm
index 9d651ce5a9..de070eab23 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -856,6 +856,21 @@
                   (string->utf8
                    (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")