From e56bc5e15969850d2c1ced2ddbe628e58cc1f680 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Thu, 6 Apr 2023 12:09:57 -0400 Subject: [PATCH] sync-pull: use jq instead of python We installed jq on the signer host so we do not need /usr/bin/python --- scripts/sync-pull | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/sync-pull b/scripts/sync-pull index 87d98c07..15633c54 100755 --- a/scripts/sync-pull +++ b/scripts/sync-pull @@ -29,9 +29,8 @@ echo "Found the most packages ($current_highest_count) in $highest_combo." need_rerun=false for endpoint in https://chacra.ceph.com/repos/$project/$release/$sha1/centos/{7,8,9} https://chacra.ceph.com/repos/$project/$release/$sha1/$highest_combo; do chacra_repo_status=$(curl -s -L $endpoint) - # python is only used here because jq isn't installed on the signer box - chacra_needs_update=$(echo $chacra_repo_status | python -mjson.tool | grep needs_update | awk '{ print $2 }' | sed 's/,$//') - chacra_is_updating=$(echo $chacra_repo_status | python -mjson.tool | grep is_updating | awk '{ print $2 }' | sed 's/,$//') + chacra_needs_update=$(echo $chacra_repo_status | jq .needs_update) + chacra_is_updating=$(echo $chacra_repo_status | jq .is_updating) if [ "$chacra_needs_update" == "true" ] || [ "$chacra_is_updating" == "true" ]; then need_rerun=true @@ -45,7 +44,7 @@ if [[ "$release" =~ ^[a-n].* ]]; then else newgen=true # Get numerical version number (we only need this with Octopus or later because of the new directory/path scheme). - version=$(echo $chacra_repo_status | python -mjson.tool | grep \"version\" | awk '{ print $2 }' | sed 's/"//g') + version=$(echo $chacra_repo_status | jq -r .extra.version) [[ -d /opt/repos/$project/$release-$version ]] | mkdir -p /opt/repos/$project/$release-$version/{debian/jessie,centos/{7,8,9}} fi -- 2.47.3