Allow to specify build branch name (don't force master)

Fixes #3998
This commit is contained in:
Jérôme Schneider 2013-11-26 17:18:29 +01:00
parent 5f05a2aebb
commit d11d78f99c
1 changed files with 8 additions and 3 deletions

View File

@ -12,6 +12,7 @@ GIT_REPOSITORY_URL="git+ssh://git@repos.entrouvert.org"
DEBIAN_VERSIONS="wheezy=70 squeeze=60 lenny=50"
DISTS=""
ARCHS="amd64"
BUILD_BRANCH="master"
EOBUILDER_VERSION=5
show_help()
@ -20,6 +21,7 @@ show_help()
echo ""
echo "-h: help"
echo "-c: cleaning cache git, deb, archives, old or all"
echo "-b: branch to build (Default: master)"
echo "-a: amd64 and / or i368 (Default: amd64)"
echo "-d: Debian distribution like squeeze or / and wheezy (ex.: squeeze,wheezy)"
echo "GIT_REPOSITORY_NAME: respository name"
@ -77,6 +79,9 @@ while getopts hc:a:d: OPT; do
d)
DISTS=`echo $OPTARG | tr '[A-Z]' '[a-z]' | sed 's/,/ /g'`
;;
b)
BUILD_BRANCH=$OPTARG
;;
\?)
error "$USAGE"
;;
@ -132,7 +137,7 @@ is_something_to_build() {
echo "+ Updating git repository and parsing configuration ..."
cd $GIT_PROJECT_PATH
git checkout master
git checkout $BUILD_BRANCH
git pull
if [ -f "setup.py" ]; then
python setup.py --help >/dev/null 2>&1
@ -195,7 +200,7 @@ for DIST in $DISTS; do
DEBIAN_SECOND_INC=1
fi
fi
DEBIAN_SECOND_INC=`git rev-list --count origin/master..origin/${DEBIAN_BRANCH}`
DEBIAN_SECOND_INC=`git rev-list --count origin/${BUILD_BRANCH}..origin/${DEBIAN_BRANCH}`
PACKAGE_VERSION="$PROJECT_VERSION-$DEBIAN_FIRST_INC+eob${EOBUILDER_VERSION}"
@ -214,7 +219,7 @@ for DIST in $DISTS; do
if [ ! -f $ORIGIN_PATH/${PACKAGE_NAME}_${PROJECT_VERSION}.orig.tar.bz2 ]; then
echo "+ Generating origin tarball ..."
cd $GIT_PROJECT_PATH
git checkout master
git checkout $BUILD_BRANCH
if [ -f './setup.py' ]; then
python setup.py clean --all
python setup.py sdist --formats=bztar