From 3215f2e702b6beaa2d225b9e281bcabf830fecf7 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 9 May 2017 16:57:28 -0400 Subject: [PATCH] merge latest updates --- utils/do_debian_package.sh | 42 ++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/utils/do_debian_package.sh b/utils/do_debian_package.sh index acc412550..554dd9c38 100755 --- a/utils/do_debian_package.sh +++ b/utils/do_debian_package.sh @@ -52,7 +52,9 @@ case $i in shift # past argument with no value ;; *) - # unknown option + # unknown option + read -p "Unknown option $i, continue? (Y|n)" + [[ $REPLY == [yY] ]] && { echo "continuing..."; } || exit 1; ;; esac done @@ -66,6 +68,8 @@ fi; if [ "$DISTRO" == "" ]; then DISTRO=`lsb_release -a 2>/dev/null | grep Codename | awk '{print $2}'`; echo "Defaulting to $DISTRO for distribution"; +else + echo "Building for $DISTRO"; fi; # Release is a special mode... it uploads to the release ppa and cannot have a snapshot @@ -141,7 +145,7 @@ if [ "$SNAPSHOT" != "stable" ] && [ "$SNAPSHOT" != "" ]; then VERSION="$VERSION~$SNAPSHOT"; fi; -DIRECTORY="zoneminder_$VERSION-$DISTRO${PACKAGE_VERSION}"; +DIRECTORY="zoneminder_$VERSION"; echo "Doing $TYPE release $DIRECTORY"; mv "${GITHUB_FORK}_zoneminder_release" "$DIRECTORY.orig"; cd "$DIRECTORY.orig"; @@ -149,12 +153,12 @@ cd "$DIRECTORY.orig"; git submodule init git submodule update --init --recursive if [ "$DISTRO" == "trusty" ] || [ "$DISTRO" == "precise" ]; then - ln -sf distros/ubuntu1204 debian + mv distros/ubuntu1204 debian else if [ "$DISTRO" == "wheezy" ]; then - ln -sf distros/debian debian + mv distros/debian debian else - ln -sf distros/ubuntu1604 debian + mv distros/ubuntu1604 debian fi; fi; @@ -192,20 +196,24 @@ zoneminder ($VERSION-$DISTRO${PACKAGE_VERSION}) $DISTRO; urgency=$URGENCY EOF fi; -# Auto-install all ZoneMinder's depedencies using the Debian control file -sudo apt-get install devscripts equivs -sudo mk-build-deps -ir ./debian/control -echo "Status: $?" +rm -rf .git +rm .gitignore +cd ../ +tar zcf $DIRECTORY.orig.tar.gz $DIRECTORY.orig +cd $DIRECTORY.orig -#rm -rf .git -#rm .gitignore -#cd ../ -#tar zcf zoneminder_$VERSION-$DISTRO.orig.tar.gz zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig -#cd zoneminder_$VERSION-$DISTRO-$SNAPSHOT.orig if [ $TYPE == "binary" ]; then + # Auto-install all ZoneMinder's depedencies using the Debian control file + sudo apt-get install devscripts equivs + sudo mk-build-deps -ir ./debian/control + echo "Status: $?" DEBUILD=debuild else if [ $TYPE == "local" ]; then + # Auto-install all ZoneMinder's depedencies using the Debian control file + sudo apt-get install devscripts equivs + sudo mk-build-deps -ir ./debian/control + echo "Status: $?" DEBUILD="debuild -i -us -uc -b" else DEBUILD="debuild -S -sa" @@ -215,7 +223,11 @@ if [ "$DEBSIGN_KEYID" != "" ]; then DEBUILD="$DEBUILD -k$DEBSIGN_KEYID" fi $DEBUILD -echo "Status: $?" +if [ $? -ne 0 ]; then +echo "Error status code is: $?" + echo "Build failed."; + exit $?; +fi; cd ../ if [ "$INTERACTIVE" != "no" ]; then