Skip to content

Commit 95dc34d

Browse files
committed
verify-checksums.sh: crop checksum more aggressively
The previous scheme did not handle CR/LF line endings properly.
1 parent 3fbff1e commit 95dc34d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

verify-checksums.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ do
4040
echo "[FAIL] $file: file does not exist"
4141
continue
4242
fi
43-
expected="$(cat "$md5" | cut -d ' ' -f 1)"
43+
expected="$(cat "$md5")"
44+
expected="${expected:0:32}"
4445
actual="$(md5sum "$file" | cut -d ' ' -f 1)"
4546
if [ "$expected" == "$actual" ]
4647
then
@@ -59,7 +60,8 @@ do
5960
echo "[FAIL] $file: file does not exist"
6061
continue
6162
fi
62-
expected="$(cat "$sha1" | cut -d ' ' -f 1)"
63+
expected="$(cat "$sha1")"
64+
expected="${expected:0:40}"
6365
actual="$(sha1sum "$file" | cut -d ' ' -f 1)"
6466
if [ "$expected" == "$actual" ]
6567
then

0 commit comments

Comments
 (0)