Add support for specifying PPA

This commit is contained in:
Isaac Connor 2019-06-24 11:50:58 -04:00
parent 52f1e2d235
commit 1815bf18a9
1 changed files with 29 additions and 19 deletions

View File

@ -23,6 +23,10 @@ case $i in
INTERACTIVE="${i#*=}" INTERACTIVE="${i#*=}"
shift # past argument=value shift # past argument=value
;; ;;
-p=*|--ppa=*)
PPA="${i#*=}"
shift # past argument=value
;;
-r=*|--release=*) -r=*|--release=*)
RELEASE="${i#*=}" RELEASE="${i#*=}"
shift shift
@ -108,6 +112,23 @@ else
fi; fi;
fi fi
if [ "$PPA" == "" ]; then
if [ "$RELEASE" != "" ]; then
# We need to use our official tarball for the original source, so grab it and overwrite our generated one.
IFS='.' read -r -a VERSION <<< "$RELEASE"
if [ "${VERSION[0]}.${VERSION[1]}" == "1.30" ]; then
PPA="ppa:iconnor/zoneminder-stable"
else
PPA="ppa:iconnor/zoneminder-${VERSION[0]}.${VERSION[1]}"
fi;
else
if [ "$BRANCH" == "" ]; then
PPA="ppa:iconnor/zoneminder-master";
else
PPA="ppa:iconnor/zoneminder-$BRANCH";
fi;
fi;
fi;
# Instead of cloning from github each time, if we have a fork lying around, update it and pull from there instead. # Instead of cloning from github each time, if we have a fork lying around, update it and pull from there instead.
if [ ! -d "${GITHUB_FORK}_zoneminder_release" ]; then if [ ! -d "${GITHUB_FORK}_zoneminder_release" ]; then
@ -282,25 +303,14 @@ if [ $TYPE == "binary" ]; then
fi; fi;
else else
SC="zoneminder_${VERSION}-${DISTRO}${PACKAGE_VERSION}_source.changes"; SC="zoneminder_${VERSION}-${DISTRO}${PACKAGE_VERSION}_source.changes";
PPA="";
if [ "$RELEASE" != "" ]; then
PPA="ppa:iconnor/zoneminder";
else
if [ "$BRANCH" == "" ]; then
PPA="ppa:iconnor/zoneminder-master";
else
PPA="ppa:iconnor/zoneminder-$BRANCH";
fi;
fi;
dput="Y";
if [ "$INTERACTIVE" != "no" ]; then if [ "$INTERACTIVE" != "no" ]; then
echo "Ready to dput $SC to $PPA ? Y/N..."; read -p "Ready to dput $SC to $PPA ? Y/N...";
read dput if [[ "$REPLY" == [yY] ]]; then
fi dput $PPA $SC
if [ "$dput" == [Yy] ]; then fi;
else
echo "dputting to $PPA";
dput $PPA $SC dput $PPA $SC
fi; fi;
fi; fi;