diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-05-18 22:10:20 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-05-22 00:35:24 +0200 |
commit | 18ae1ec3ecfe22d55d6cdf595a442afebbc5595a (patch) | |
tree | 558329bc3c21c132bd1e9bd1dd471c26e60fad6c /tests | |
parent | 9418aaa00db44d3e0e3318ff66faace0d7b43326 (diff) |
guix hash, guix download: Add '--hash'.
* guix/scripts/download.scm (%default-options): Add 'hash-algorithm'.
(show-help, %options): Add "--hash".
(guix-download): Honor it.
* guix/scripts/hash.scm (%default-options): Add 'hash-algorithm'.
(show-help, %options): Add "--hash".
(guix-hash): Honor it.
* tests/guix-hash.sh: Test '-H sha512'.
* doc/guix.texi (Invoking guix download): Document it.
(Invoking guix hash): Document it.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/guix-hash.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/guix-hash.sh b/tests/guix-hash.sh index 190c9e7f8a..1c595b49ed 100644 --- a/tests/guix-hash.sh +++ b/tests/guix-hash.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2013, 2014, 2016 Ludovic Courtès <ludo@gnu.org> +# Copyright © 2013, 2014, 2016, 2020 Ludovic Courtès <ludo@gnu.org> # Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org> # # This file is part of GNU Guix. @@ -31,6 +31,10 @@ test `echo -n | guix hash -` = 0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9 test `guix hash -f nix-base32 /dev/null` = 0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73 test `guix hash -f hex /dev/null` = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 test `guix hash -f base32 /dev/null` = 4oymiquy7qobjgx36tejs35zeqt24qpemsnzgtfeswmrw6csxbkq +test `guix hash -H sha512 -f hex /dev/null` = cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e + +if guix hash -H abcd1234 /dev/null; +then false; else true; fi mkdir "$tmpdir" echo -n executable > "$tmpdir/exe" |