From 5639afe8a055d36421ceeb843c8f6aadeec6f3b2 Mon Sep 17 00:00:00 2001 From: Leo Izen Date: Sun, 15 Oct 2017 14:18:53 -0400 Subject: test: use POSIX-compliant printf The test shell script had previously used \x notation, which is not POSIX-compliant and therefore is "undefined behavior." In this case, the script will fail if /bin/sh is DASH or some other minimal shell. This commit replaces the hexadecimal \x notation with \ddd octal notation, which is strictly POSIX-compliant and will work in any POSIX shell located at /bin/sh. --- test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test b/test index 3442e0d..11caa5d 100755 --- a/test +++ b/test @@ -24,7 +24,7 @@ test "$(printf '' | ./keccak-512sum)" = '0EAB42DE4C3CEB9235FC91ACFFE746B29C29A8C test "$(printf '' | ./sha3-224sum -u)" = '6B4E03423667DBB73B6E15454F0EB1ABD4597F9A1B078E3F5B5A6BC7 -' test "$(printf '' | ./sha3-224sum -l)" = '6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7 -' -test "$(printf '' | ./sha3-224sum -b)" = "$(printf '\x6B\x4E\x03\x42\x36\x67\xDB\xB7\x3B\x6E\x15\x45\x4F\x0E\xB1\xAB\xD4\x59\x7F\x9A\x1B\x07\x8E\x3F\x5B\x5A\x6B\xC7')" +test "$(printf '' | ./sha3-224sum -b)" = "$(printf '\153\116\003\102\066\147\333\267\073\156\025\105\117\016\261\253\324\131\177\232\033\007\216\077\133\132\153\307')" test "$(printf '' | ./rawshake256sum -N 128)" = '3A1108D4A90A31B85A10BDCE77F4BFBD -' -- cgit v1.2.3-70-g09d2 From 965c4e578c2a4fa5120ccf284945a6a0d1fa6eba Mon Sep 17 00:00:00 2001 From: Leo Izen Date: Sun, 15 Oct 2017 14:24:50 -0400 Subject: Makefile: use "rm -f" upon cleaning and uninstalling The coreutil "rm" will by default exit with failure if it is instructed to remove a file that doesn't exist. Using "rm -f" will suppress this behavior, so "rm" will exit with success whether or not the file had existed before invoking "rm -f". --- Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c32e80c..fce9bfe 100644 --- a/Makefile +++ b/Makefile @@ -73,13 +73,12 @@ install: $(BIN) $(MAN1) cp -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/sha3sum/" uninstall: - -cd -- "$(DESTDIR)$(PREFIX)/bin" && rm -- $(BIN) - -cd -- "$(DESTDIR)$(MANPREFIX)/man1" && rm -- $(MAN1) - -rm -- "$(DESTDIR)$(PREFIX)/share/licenses/sha3sum/LICENSE" - -rmdir -- "$(DESTDIR)$(PREFIX)/share/licenses/sha3sum" + -cd -- "$(DESTDIR)$(PREFIX)/bin" && rm -f -- $(BIN) + -cd -- "$(DESTDIR)$(MANPREFIX)/man1" && rm -f -- $(MAN1) + -rm -rf -- "$(DESTDIR)$(PREFIX)/share/licenses/sha3sum" clean: - -rm -r -- $(MAN1) $(BIN) keccak-*sum.c sha3-*sum.c rawshake*sum.c shake*sum.c .testdir + -rm -rf -- $(MAN1) $(BIN) keccak-*sum.c sha3-*sum.c rawshake*sum.c shake*sum.c .testdir .SUFFIXES: -- cgit v1.2.3-70-g09d2