Skip to content

Commit 3fbff1e

Browse files
committed
verify-checksums.sh: support alt. checksum format
Some checksum files do not simply have the checksum, but are also appended by a path; e.g.: $ cat ~/.m2/repository/ant/ant/1.6/ant-1.6.pom.sha1 04ebfa03f2baf244c7c7bc2a754cb03221ebfc29 /home/projects/maven/repository-staging/to-ibiblio/maven2/ant/ant/1.6/ant-1.6.pom As an aside, this is almost certainly an error in the version of the hashing plugin used to write that file -- the default output of sha1sum is to append the full path to the file after the checksum, so presumably that information was not removed as it seems to be with newer artifacts. In any case, it's easy for this script to support both formats.
1 parent 6742273 commit 3fbff1e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

verify-checksums.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ do
4040
echo "[FAIL] $file: file does not exist"
4141
continue
4242
fi
43-
expected="$(cat "$md5")"
43+
expected="$(cat "$md5" | cut -d ' ' -f 1)"
4444
actual="$(md5sum "$file" | cut -d ' ' -f 1)"
4545
if [ "$expected" == "$actual" ]
4646
then
@@ -59,7 +59,7 @@ do
5959
echo "[FAIL] $file: file does not exist"
6060
continue
6161
fi
62-
expected="$(cat "$sha1")"
62+
expected="$(cat "$sha1" | cut -d ' ' -f 1)"
6363
actual="$(sha1sum "$file" | cut -d ' ' -f 1)"
6464
if [ "$expected" == "$actual" ]
6565
then

0 commit comments

Comments
 (0)