From ed63b7f87e88b0ce9c4a78bf0529599de9172b1f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 3 Jan 2021 21:59:49 +0100 Subject: guix hash: Honor '-H' when used alongside '-r'. * guix/scripts/hash.scm (guix-hash): When 'recursive? is true, use 'open-hash-port' instead of 'open-sha256-port'. * tests/guix-hash.sh: Add test for 'guix hash -r -H sha512'. --- tests/guix-hash.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/guix-hash.sh b/tests/guix-hash.sh index 346355539f..c4461fa955 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, 2020 Ludovic Courtès +# Copyright © 2013, 2014, 2016, 2020, 2021 Ludovic Courtès # Copyright © 2016 Jan Nieuwenhuizen # # This file is part of GNU Guix. @@ -43,6 +43,7 @@ chmod +x "$tmpdir/exe" mkdir "$tmpdir/subdir" test `guix hash -r "$tmpdir"` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p +test `guix hash -r "$tmpdir" -H sha512` = 301ra58c2vahczzxiyfin41mpyb0ljh4dh9zn3ijvwviaw1j40sfzw5skh9x945da88n3785ggifzig7acd6k72h0mpsc20m1f66m9n # Without '-r', this should fail. ! guix hash "$tmpdir" -- cgit v1.2.3