Permalink
Browse files

Allow skipping the build if the package has been built

  • Loading branch information...
1 parent c9c91dd commit 0aa345be7155e2bfa9fbb96bad5b11259e4adf4c @dchenbecker committed Mar 28, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 oab-java6.sh
View
@@ -64,6 +64,7 @@ function usage() {
echo " sudo ${0}"
echo
echo "Optional parameters"
+ echo " -s : Skip building if the package exists"
echo " -c : Remove pre-existing packages from '/var/local/oab/deb'"
echo " -h : This help"
echo
@@ -196,14 +197,15 @@ BUILD_KEY=""
BUILD_CLEAN=0
# Parse the options
-OPTSTRING=bchk:
+OPTSTRING=bchk:s
while getopts ${OPTSTRING} OPT
do
case ${OPT} in
b) build_docs;;
c) BUILD_CLEAN=1;;
h) usage;;
k) BUILD_KEY=${OPTARG};;
+ s) SKIP_REBUILD=1;;
*) usage;;
esac
done
@@ -303,6 +305,11 @@ done
# Determine the new version
NEW_VERSION="${DEB_VERSION}~${LSB_CODE}1"
+if [ -n "$SKIP_REBUILD" -a -r "/var/local/oab/deb/sun-java${JAVA_VER}_${NEW_VERSION}_${LSB_ARCH}.changes" ]; then
+ echo " [x] Package exists, skipping build "
+ exit
+fi
+
# Genereate a build message
BUILD_MESSAGE="Automated build for ${LSB_REL} using https://github.com/rraptorr/sun-java6"

0 comments on commit 0aa345b

Please sign in to comment.