diff --git a/vim-update.sh b/vim-update.sh index 38b0673..2faea55 100755 --- a/vim-update.sh +++ b/vim-update.sh @@ -86,16 +86,22 @@ 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` + | grep $releases_regexp` testing_update=`bodhi updates query --packages vim --status testing \ - | grep $releases` + | grep $releases_regexp` if [ "$pending_update" == "" ] && [ "$testing_update" == "" ]; then - fedpkg build --nowait - bodhi updates new --user zdohnal --type enhancement --notes "The newest \ - upstream commit" --request testing --autokarma --stable-karma 3 \ - --unstable-karma -3 vim-${UPSTREAMMAJOR}-${LASTPLFILLED}-1.\ - ${releases[@]: $branches_index: 1} + fedpkg build + if [ $? -eq 0 ]; then + bodhi updates new --user zdohnal --type enhancement --notes "The newest \ + upstream commit" --request testing --autokarma --stable-karma 3 \ + --unstable-karma -3 vim-${UPSTREAMMAJOR}-${LASTPLFILLED}-1.\ + ${releases[@]: $branches_index: 1} + else + echo "Error when building package in $branch" + exit 1 + fi else echo "There are pending/testing updates, do not build package." fi @@ -126,17 +132,23 @@ 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` + | grep $releases_regexp` testing_update=`bodhi updates query --packages vim --status testing \ - | grep $releases` + | grep $releases_regexp` if [ "$pending_update" == "" ] && [ "$testing_update" == "" ]; then - fedpkg build --nowait - if [ ${branches[@]: $branches_index: 1} != "master" ]; then - bodhi updates new --user zdohnal --type enhancement --notes "The newest \ - upstream commit" --request testing --autokarma --stable-karma 3 \ - --unstable-karma -3 vim-${UPSTREAMMAJOR}-${LASTPLFILLED}-1.\ - ${releases[@]: $branches_index: 1} + fedpkg build + if [ $? -eq 0 ]; then + if [ ${branches[@]: $branches_index: 1} != "master" ]; then + bodhi updates new --user zdohnal --type enhancement --notes "The newest \ + upstream commit" --request testing --autokarma --stable-karma 3 \ + --unstable-karma -3 vim-${UPSTREAMMAJOR}-${LASTPLFILLED}-1.\ + ${releases[@]: $branches_index: 1} + fi + else + echo "Error when building package for $branch" + exit 1 fi fi diff --git a/vim.spec b/vim.spec index d9f8177..37804e0 100644 --- a/vim.spec +++ b/vim.spec @@ -770,6 +770,7 @@ rm -rf %{buildroot} %changelog * Thu Sep 14 2017 Karsten Hopp 8.0.1102-1 +- vim-update.sh - add test for succesful build and fixing grepping of update's list - patchlevel 1102 * Wed Sep 13 2017 Karsten Hopp 8.0.1098-1