From 6e08f07f2032cd85cd67beadf7a91b5c26d0619d Mon Sep 17 00:00:00 2001 From: zimoun Date: Thu, 18 Nov 2021 01:20:21 +0100 Subject: guix hash: Support several files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/scripts/hash.scm (guix-hash): Allow several files. [file-hash]: Catch system-error. [formatted-hash]: New procedure. * tests/guix-hash.sh: Add test. * doc/guix.texi (Invoking guix hash): Mention "one or more files". Co-authored-by: Ludovic Courtès --- tests/guix-hash.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/guix-hash.sh') diff --git a/tests/guix-hash.sh b/tests/guix-hash.sh index c4461fa955..1e9a0ec734 100644 --- a/tests/guix-hash.sh +++ b/tests/guix-hash.sh @@ -34,6 +34,12 @@ test `guix hash -f base32 /dev/null` = 4oymiquy7qobjgx36tejs35zeqt24qpemsnzgtfes test `guix hash -H sha512 -f hex /dev/null` = cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e test `guix hash -H sha1 -f base64 /dev/null` = "2jmj7l5rSw0yVb/vlWAYkK/YBwk=" +# Several files. +test "`guix hash /dev/null "$abs_top_srcdir/README"`" = "`guix hash /dev/null ; guix hash "$abs_top_srcdir/README"`" + +# Zero files. +! guix hash + ! guix hash -H abcd1234 /dev/null mkdir "$tmpdir" -- cgit v1.2.3