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:
@@ -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")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user