]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coverity: replace python with jq
authorEvgeny Vereshchagin <evvers@ya.ru>
Tue, 29 Oct 2019 19:07:15 +0000 (19:07 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 30 Oct 2019 08:17:04 +0000 (09:17 +0100)
Judging by https://travis-ci.org/systemd/systemd/jobs/604425785
(where the script failed with "tools/coverity.sh: line 45: python: command not found")
python-unversioned-command is no longer installed by default with python2.
Given that it's not the first time python has vanished and it's not clear
what exactly should be installed to make sure it's there, let's just use jq instead.

tools/coverity.sh
travis-ci/managers/fedora.sh

index e32f5b3993b68eabfb53de1d3166a1e06e935a91..8edce065caeaf6d5b99df1b4bc44d711106ded5f 100755 (executable)
@@ -42,11 +42,11 @@ if [ "$AUTH_RES" = "Access denied" ]; then
     echo -e "\033[33;1mCoverity Scan API access denied. Check COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN.\033[0m"
     exit 1
 else
-    AUTH=`echo $AUTH_RES | python -c "import sys, json; print(json.load(sys.stdin)['upload_permitted'])"`
-    if [ "$AUTH" = "True" ]; then
+    AUTH=`echo $AUTH_RES | jq .upload_permitted`
+    if [ "$AUTH" = "true" ]; then
         echo -e "\033[33;1mCoverity Scan analysis authorized per quota.\033[0m"
     else
-        WHEN=`echo $AUTH_RES | python -c "import sys, json; print(json.load(sys.stdin)['next_upload_permitted_at'])"`
+        WHEN=`echo $AUTH_RES | jq .next_upload_permitted_at`
         echo -e "\033[33;1mCoverity Scan analysis NOT authorized until $WHEN.\033[0m"
         exit 1
     fi
index 38cb3d3158454a604890fd07bab79a68a0108486..6e81d14b334f1b66b652883cec588b2f5156d9ee 100755 (executable)
@@ -16,7 +16,7 @@ DOCKER_EXEC="${DOCKER_EXEC:-docker exec -it $CONT_NAME}"
 DOCKER_RUN="${DOCKER_RUN:-docker run}"
 REPO_ROOT="${REPO_ROOT:-$PWD}"
 ADDITIONAL_DEPS=(dnf-plugins-core
-                 python2 iputils
+                 jq iputils
                  hostname libasan
                  python3-pyparsing
                  python3-evdev