From 7e14bc098bc898f9978e5f3335ea58a852d0a665 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Dec 15 2021 12:12:22 +0000 Subject: vim-update.sh: check only for bodhi enabled testing rpms --- diff --git a/vim-update.sh b/vim-update.sh index 31514d7..45e82f1 100755 --- a/vim-update.sh +++ b/vim-update.sh @@ -13,7 +13,7 @@ release_index=0 regexp_index=0 bodhi_enabled_index=0 done_build=0 -releases_regexp="${regexps[@]: regexp_index: 1}" +releases_regexp="" let "regexp_index+=1" cd `dirname $0` @@ -104,23 +104,12 @@ if [ $CHANGES -ne 0 ]; then exit 1 fi - # Check if release has pending or testing update - if not, build package - # and submit update for testing - pending_update=`bodhi updates query --packages vim --status pending \ - | grep $releases_regexp` - testing_update=`bodhi updates query --packages vim --status testing \ - | grep $releases_regexp` - - if [ "$pending_update" == "" ] && [ "$testing_update" == "" ]; then - $debug fedpkg build - if [ $? -eq 0 ]; then - done_build=1 - else - echo "Error when building package in $branch" - exit 1 - fi + $debug fedpkg build + if [ $? -eq 0 ]; then + done_build=1 else - echo "There are pending/testing updates, do not build package." + echo "Error when building package in $branch" + exit 1 fi let "release_index+=1" @@ -152,10 +141,13 @@ if [ $CHANGES -ne 0 ]; then exit 1 fi - # append next release to regexp - because we need to check if there aren't - # any testing updates from higher branches (lower branch cannot have - # bigger NVR than higher branch) in next iteration - releases_regexp="$releases_regexp${regexps[@]: regexp_index: 1}" + # append next release to regexp if the branch is enabled in bodhi - because we + # need to check if there aren't any testing updates from higher enabled branches + # (lower branch cannot have bigger NVR than higher branch) in next iteration + if [ ${bodhi_enabled[@]: $bodhi_enabled_index: 1} -eq 1 ] + then + releases_regexp="$releases_regexp${regexps[@]: regexp_index: 1}" + fi # Check if release has pending or testing update - if not, build package # and submit update for testing @@ -167,7 +159,7 @@ if [ $CHANGES -ne 0 ]; then if [ "$testing_update" == "" ] && [ $done_build -eq 1 ]; then $debug fedpkg build if [ $? -eq 0 ]; then - # if branch isn't rawhide or branch is enabled in bodhi, create update + # if branch isn't rawhide or branch is enabled in bodhi, suggest creating update in the end if [ $branch != "rawhide" ] || [ ${bodhi_enabled[@]: $bodhi_enabled_index: 1} -eq 1 ]; then needs_update+=("bodhi updates new --user $(rpmdev-packager) --type enhancement --notes \"The newest upstream commit\" --request testing --autotime --autokarma --stable-karma 3 --unstable-karma -3 vim-${UPSTREAMMAJOR}.${LASTPLFILLED}-1.${releases[@]: $release_index: 1}") fi