From 59f2079f68bed955e2cf6af48a8dea17cf6b27f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 13 Oct 2020 14:37:06 +0200 Subject: [PATCH] Support INSTALL_OR_SKIP for marshalparser test --- marshalparser/test_marshalparser_compatibility.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/marshalparser/test_marshalparser_compatibility.sh b/marshalparser/test_marshalparser_compatibility.sh index 2c8d254..2d32537 100755 --- a/marshalparser/test_marshalparser_compatibility.sh +++ b/marshalparser/test_marshalparser_compatibility.sh @@ -15,6 +15,16 @@ VERSION=${VERSION:-3.9} # How many randomly-selected pyc files to check? SAMPLE=${SAMPLE:-50} +# This allows us to test marshalparser optionally: on Fedora 33+ only +INSTALL_OR_SKIP=${INSTALL_OR_SKIP:-false} +if [ "$INSTALL_OR_SKIP" == "true" ] && [ ! -f "/usr/bin/marshalparser" ]; then + dnf -y install marshalparser || : + if [ ! -f "/usr/bin/marshalparser" ]; then + echo "marshalparser not installable, skipping this test" + exit 0 + fi +fi + path="/usr/lib*/python$VERSION/" for file in `find $path -name "*.pyc" | shuf | head -n $SAMPLE`; do