aboutsummaryrefslogtreecommitdiff
path: root/tests/guix-hash.sh
Commit message (Collapse)AuthorAge
* tests: Fix checks for expected failures.Eric Bavier2023-04-21
| | | | | | | | | | | | | | | | | | | Addresses <https://issues.guix.gnu.org/62406>. With 'set -e', a return status inverted with '!' does not cause the shell to exit immediately. Instead use '&& false' to indicate an expected failure. * tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment-container.sh, tests/guix-environment.sh, tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-home.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh, tests/guix-refresh.sh, tests/guix-shell.sh, tests/guix-style.sh, tests/guix-system.sh: Replace uses of '! ...' with '... && false' or `test ! ...` as appropriate. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix hash: Allow '--exclude-vcs' option using 'git' serializer.zimoun2022-01-04
| | | | | | | | * guix/scripts/hash.scm (git-hash): Use '#:select?' with 'git-hash-directory'. * tests/guix-hash.sh: Adjust accordingly. Signed-off-by: Timothy Sample <samplet@ngyro.com>
* guix hash: Add git serializer.zimoun2021-12-17
| | | | | | | | | * guix/scripts/hash.scm (git-hash): New procedure. (%options): Use it. * tests/guix-hash.sh: Test it. * doc/guix.texi: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix hash: Add 'serializer' option.zimoun2021-12-17
| | | | | | | | | | | | | * guix/scripts/hash.scm (%options): Deprecate 'recursive', add 'serializer'. (%default-options): Add 'serializer'. (nar-hash): New procedure. (default-hash): New procedure. (guix-hash)[file-hash]: Use them. (show-help): Adjust. * tests/guix-hash.scm: Adjust. * doc/guix.texi: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix hash: Support several files.zimoun2021-12-17
| | | | | | | | | | * 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 <ludo@gnu.org>
* guix hash: Honor '-H' when used alongside '-r'.Ludovic Courtès2021-01-04
| | | | | | * 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: Simplify shell exit status negation;Eric Bavier2020-09-28
| | | | | | | | | | * tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment.sh, tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-lint.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh: Use the shell '!' keyword to negate command exit status in place of 'if ...; then false; else true; fi'
* guix hash, guix download: Support base64 format.Ludovic Courtès2020-05-22
| | | | | | | | * guix/scripts/download.scm (show-help, %options): Support "base64" format. * guix/scripts/hash.scm (show-help, %options): Likewise. * tests/guix-hash.sh: Test it. * doc/guix.texi (Invoking guix hash): Document it.
* guix hash, guix download: Add '--hash'.Ludovic Courtès2020-05-22
| | | | | | | | | | | | * 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.
* guix hash: Interpret '-' as standard input.Ludovic Courtès2016-10-28
| | | | | | * guix/scripts/hash.scm (guix-hash)[file-hash]: Special-case "-". * tests/guix-hash.sh: Add test. * doc/guix.texi (Invoking guix hash): Document it.
* guix hash: Add --exclude-vcs option.Jan Nieuwenhuizen2016-09-07
| | | | | | | | | | * guix/scripts/hash.scm (show-help): Add help text for --exclude-vcs option. (%options): Add --exclude-vcs option. (guix-hash): Handle exclude-vcs option. * doc/guix.texi ("Invoking guix hash"): Update doc. * tests/guix-hash.sh: Add test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* guix hash: Add '--recursive'.Ludovic Courtès2014-02-21
| | | | | | | | | | | | * guix/scripts/hash.scm (show-help): Add --recursive. (%options): Likewise. (guix-hash)[file-hash]: New procedure. Honor --recursive. Use it. * guix/nar.scm (write-file): Add missing field to the &nar-error condition raised upon unsupported file type; change its message to be more descriptive. * tests/guix-hash.sh: Add tests with -r. * doc/guix.texi (Invoking guix hash): Document --recursive.
* tests: Add `guix hash' test.Ludovic Courtès2013-05-11
* guix/scripts/hash.scm (guix-hash)[eof->null]: New procedure. Use it to convert the EOF object to the empty bytevector. * tests/guix-hash.sh: New file. * Makefile.am (SH_TESTS): Add it.