Skip to content

Commit

Permalink
Allow skipping the build if the package has been built
Browse files Browse the repository at this point in the history
  • Loading branch information
dchenbecker committed Mar 28, 2012
1 parent c9c91dd commit 0aa345b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion oab-java6.sh
Expand Up @@ -64,6 +64,7 @@ function usage() {
echo " sudo ${0}" echo " sudo ${0}"
echo echo
echo "Optional parameters" echo "Optional parameters"
echo " -s : Skip building if the package exists"
echo " -c : Remove pre-existing packages from '/var/local/oab/deb'" echo " -c : Remove pre-existing packages from '/var/local/oab/deb'"
echo " -h : This help" echo " -h : This help"
echo echo
Expand Down Expand Up @@ -196,14 +197,15 @@ BUILD_KEY=""
BUILD_CLEAN=0 BUILD_CLEAN=0


# Parse the options # Parse the options
OPTSTRING=bchk: OPTSTRING=bchk:s
while getopts ${OPTSTRING} OPT while getopts ${OPTSTRING} OPT
do do
case ${OPT} in case ${OPT} in
b) build_docs;; b) build_docs;;
c) BUILD_CLEAN=1;; c) BUILD_CLEAN=1;;
h) usage;; h) usage;;
k) BUILD_KEY=${OPTARG};; k) BUILD_KEY=${OPTARG};;
s) SKIP_REBUILD=1;;
*) usage;; *) usage;;
esac esac
done done
Expand Down Expand Up @@ -303,6 +305,11 @@ done
# Determine the new version # Determine the new version
NEW_VERSION="${DEB_VERSION}~${LSB_CODE}1" 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 # Genereate a build message
BUILD_MESSAGE="Automated build for ${LSB_REL} using https://github.com/rraptorr/sun-java6" BUILD_MESSAGE="Automated build for ${LSB_REL} using https://github.com/rraptorr/sun-java6"


Expand Down

0 comments on commit 0aa345b

Please sign in to comment.