Daily-build of stretch/unstable uses branch stretch-unstable

This commit is contained in:
Alexandre Aubin 2017-09-22 19:37:31 +02:00
parent bace0d0c96
commit 59e73b45d3

22
daily-build Executable file → Normal file
View file

@ -31,12 +31,28 @@ function build_if_needed()
cd $GIT_REPOS/$PACKAGE
git fetch origin
git checkout $BRANCH_NIGHTLY >/dev/null 2>/dev/null
if [ -z "$(git log $BRANCH_NIGHTLY..origin/$BRANCH_NIGHTLY)" ]; then
# Check if there's a branch named distrib-branch (e.g. stretch-unstable)
# By default, keep just 'branch'
BRANCH_NIGHTLY_GIT="$BRANCH_NIGHTLY"
if git branch --list | awk '{print $1}' | grep -q "^$DISTRIB-$BRANCH_NIGHTLY$"
then
BRANCH_NIGHTLY_GIT="$DISTRIB-$BRANCH_NIGHTLY"
fi
# If the branch name is an alias to another branch, "resolve" the alias
if grep -q "ref: " .git/refs/heads/$BRANCH_NIGHTLY_GIT
then
BRANCH_NIGHTLY_GIT=$(cat .git/refs/heads/$BRANCH_NIGHTLY_GIT | tr '/' ' ' | awk '{print $4}')
fi
git checkout $BRANCH_NIGHTLY_GIT >/dev/null 2>/dev/null
if [ -z "$(git log ${BRANCH_NIGHTLY_GIT}..origin/${BRANCH_NIGHTLY_GIT})" ]; then
echo "Sources up-to-date, nothing to build."
return
fi
git pull origin $BRANCH_NIGHTLY >/dev/null
git pull origin $BRANCH_NIGHTLY_GIT >/dev/null
VERSION=$(dpkg-parsechangelog -S Version 2>/dev/null)
VERSION_NIGHTLY="${VERSION}~${TIMETAG}"