avoid spurious deletion of slashing test vectors (#12)

Slashing tests tarball and output is deleted by unpack script even when
it didn't change. Hardened the logic to avoid that.
This commit is contained in:
Etan Kissling 2022-12-11 17:53:59 +01:00 committed by GitHub
parent fee2e3d12d
commit 186d992345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -74,7 +74,7 @@ done
# delete tarballs and unpacked data from old versions
for tpath in tarballs/slashing-*; do
tdir="$(basename "$tpath")"
if [[ ! " ${VERSIONS[@]} " =~ " $tdir " ]]; then
if [[ ! " slashing-${VERSIONS[@]} " =~ " $tdir " ]]; then
rm -rf "$tpath"
fi
done

View File

@ -75,12 +75,18 @@ done
# delete tarballs and unpacked data from old versions
for tpath in tarballs/*; do
if [[ "$tpath" == "tarballs/slashing-"* ]]; then
continue # avoid interfering with slashing interchange tests
fi
tdir="$(basename "$tpath")"
if [[ ! " ${VERSIONS[@]} " =~ " $tdir " ]]; then
rm -rf "$tpath"
fi
done
for tpath in tests-*; do
if [[ "$tpath" == "tests-slashing-"* ]]; then
continue # avoid interfering with slashing interchange tests
fi
tver="$(echo "$tpath" | sed -e's/^tests-//')"
if [[ ! " ${VERSIONS[@]} " =~ " $tver " ]]; then
rm -rf "$tpath"