Skip to content

Commit

Permalink
fixup! reftests: add tests for the extra-files field and the extra-so…
Browse files Browse the repository at this point in the history
…urces section
  • Loading branch information
rjbou committed Aug 25, 2023
1 parent 1ae9155 commit 20aa0ca
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tests/reftests/extrasource.test
Expand Up @@ -13,7 +13,6 @@ set -ue

eval "MD5_PATH=\"$PATCH_MD5_PATH\""
eval "SHA256_PATH=\"$PATCH_SHA256_PATH\""
kind="patch"

if command -v cygpath 2> /dev/null > /dev/null ; then
MD5_PATH=`cygpath -u "$MD5_PATH"`
Expand All @@ -23,8 +22,8 @@ fi
check2sum () {
kind=$1
path=$2
hsh=`openssl $kind $path | cut -f 2 -d ' '`
name=`basename $path`
hsh=`openssl "$kind" "$path" | cut -f 2 -d ' '`
name=`basename "$path"`
if [ "$name" = "$hsh" ]; then
echo "with matching checksum"
else
Expand All @@ -35,19 +34,19 @@ check () {
path=$1
if [ -L "$path" ] ; then
out="link,"
realpath=`realpath -mLP $path`
realpath=`realpath -mLP "$path"`
if [ "$realpath" = "$MD5_PATH" ]; then
out="$out to md5 $kind"
out="$out to md5 patch"
elif [ "$realpath" = "$SHA256_PATH" ]; then
out="$out to sha256 $kind"
out="$out to sha256 patch"
else
out="$out to unknown path $realpath"
fi
elif [ -f "$path" ] ; then
out="$kind,"
if echo $path | grep -q md5 ; then
out="patch,"
if echo "$path" | grep -q md5 ; then
out="$out `check2sum md5 $path`"
elif echo $path | grep -q sha256 ; then
elif echo "$path" | grep -q sha256 ; then
out="$out `check2sum sha256 $path`"
else
out="$out no checksum validation"
Expand Down

0 comments on commit 20aa0ca

Please sign in to comment.