1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-28 12:01:49 +02:00

store: Add query-path-info operation.

* guix/store.scm (<path-info>): New record type.
  (read-path-info): New procedure.
  (read-arg): Add 'path-info' syntax.
  (query-path-info): New variable.
* tests/store.scm ("query-path-info"): New test.
This commit is contained in:
David Thompson
2015-03-17 10:19:36 -04:00
parent 4cd27cd60a
commit 533d1768f4
2 changed files with 43 additions and 1 deletions
+10
View File
@@ -606,6 +606,16 @@
(file (add %store "foo" "Lowered.")))
(call-with-input-file file get-string-all)))
(test-assert "query-path-info"
(let* ((ref (add-text-to-store %store "ref" "foo"))
(item (add-text-to-store %store "item" "bar" (list ref)))
(info (query-path-info %store item)))
(and (equal? (path-info-references info) (list ref))
(equal? (path-info-hash info)
(sha256
(string->utf8
(call-with-output-string (cut write-file item <>))))))))
(test-end "store")