From 7b5e9968ad5f1b96f21248cfb67a7ae37275131c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 4 May 2017 16:14:43 -0400 Subject: [PATCH] fixup zmrepo options for releases and master --- utils/do_debian_package.sh | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/utils/do_debian_package.sh b/utils/do_debian_package.sh index a035b1dd5..ea6a26946 100755 --- a/utils/do_debian_package.sh +++ b/utils/do_debian_package.sh @@ -127,11 +127,7 @@ else fi; cd "${GITHUB_FORK}_zoneminder_release" -if [ $RELEASE ]; then - git checkout $RELEASE -else git checkout $BRANCH -fi; cd ../ VERSION=`cat ${GITHUB_FORK}_zoneminder_release/version` @@ -146,6 +142,11 @@ fi; DIRECTORY="zoneminder_$VERSION"; echo "Doing $TYPE release $DIRECTORY"; mv "${GITHUB_FORK}_zoneminder_release" "$DIRECTORY.orig"; +if [ $? -ne 0 ]; then + echo "Error status code is: $?" + echo "Setting up build dir failed."; + exit $?; +fi; cd "$DIRECTORY.orig"; git submodule init @@ -214,6 +215,7 @@ else echo "Status: $?" DEBUILD="debuild -i -us -uc -b" else + # Source build, don't need build depends. DEBUILD="debuild -S -sa" fi; fi; @@ -230,10 +232,10 @@ fi; cd ../ if [ "$INTERACTIVE" != "no" ]; then read -p "Do you want to keep the checked out version of Zoneminder (incase you want to modify it later) [y/N]" - [[ $REPLY == [yY] ]] && { mv $DIRECTORY zoneminder_release; echo "The checked out copy is preserved in zoneminder_release"; } || { rm -fr $DIRECTORY; echo "The checked out copy has been deleted"; } + [[ $REPLY == [yY] ]] && { mv "$DIRECTORY.orig" zoneminder_release; echo "The checked out copy is preserved in zoneminder_release"; } || { rm -fr "$DIRECTORY.orig"; echo "The checked out copy has been deleted"; } echo "Done!" else - rm -fr $DIRECTORY; echo "The checked out copy has been deleted"; + rm -fr "$DIRECTORY.orig"; echo "The checked out copy has been deleted"; fi if [ $TYPE == "binary" ]; then @@ -244,11 +246,19 @@ if [ $TYPE == "binary" ]; then sudo dpkg -i $DIRECTORY*.deb fi; if [ "$DISTRO" == "jessie" ]; then - echo "Do you want to upload this binary to zmrepo? (y/N)" - read install - if [ "$install" == "Y" ]; then - scp "zoneminder_*-${VERSION}-${DISTRO}*" "zmrepo@zmrepo.connortechnology.com:debian/${BRANCH}/mini-dinstall/incoming/" + echo "Do you want to upload this binary to zmrepo? (y/N)" + read install + if [ "$install" == "Y" ]; then + if [ "$RELEASE" != "" ]; then + scp "zoneminder_${VERSION}-${DISTRO}*" "zmrepo@zmrepo.connortechnology.com:debian/stable/mini-dinstall/incoming/" + else + if [ "$BRANCH" == "" ]; then + scp "zoneminder_${VERSION}-${DISTRO}*" "zmrepo@zmrepo.connortechnology.com:debian/master/mini-dinstall/incoming/" + else + scp "zoneminder_${VERSION}-${DISTRO}*" "zmrepo@zmrepo.connortechnology.com:debian/${BRANCH}/mini-dinstall/incoming/" + fi; fi; + fi; fi; fi; else