Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit be02fcb

Browse files
committed
HashProgramOutput: Filter md5sum output to match expected format.
git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@111460 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 82df25c commit be02fcb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

HashProgramOutput.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ if [ $# != 1 ]; then
66
fi
77

88
md5cmd=$(which md5sum)
9+
is_md5sum=1
910
if [ ! -x "$md5cmd" ]; then
1011
md5cmd=$(which md5)
12+
is_md5sum=0
1113
if [ ! -x "$md5cmd" ]; then
1214
echo "error: unable to find either 'md5sum' or 'md5'"
1315
exit 1
1416
fi
1517
fi
1618

1719
mv $1 $1.bak
18-
$md5cmd < $1.bak > $1
20+
if [ $is_md5sum = "0" ]; then
21+
$md5cmd < $1.bak > $1
22+
else
23+
$md5cmd < $1.bak | cut -d' ' -f 1 > $1
24+
fi
1925
rm -f $1.bak

0 commit comments

Comments
 (0)