add APT_GET_OPTIONS to let jobs specific command line flags

This is for things like adding --allow-unauthenticated when using CI aptly
repos.
This commit is contained in:
Hans-Christoph Steiner 2018-06-05 11:36:20 +02:00
parent f84c7aaec1
commit 3fa250a25b
1 changed files with 10 additions and 5 deletions

View File

@ -11,23 +11,28 @@ if [[ ! -f $lockfile ]] ; then
set -e set -e
set -x set -x
apt_get="apt-get -qy"
if [ ! -z "$APT_GET_OPTIONS" ]; then
apt_get="$apt_get $APT_GET_OPTIONS"
fi
if [ ! -z "$DEBIAN_RELEASE" ]; then if [ ! -z "$DEBIAN_RELEASE" ]; then
sed -i "s, testing , $DEBIAN_RELEASE ," /etc/apt/sources.list sed -i "s, testing , $DEBIAN_RELEASE ," /etc/apt/sources.list
fi fi
apt-get -qy update $apt_get update
apt-get -qy dist-upgrade $apt_get dist-upgrade
cd $CI_PROJECT_DIR cd $CI_PROJECT_DIR
if dpkg --compare-versions `dpkg -s apt |sed -n 's,^Version: \(.*\),\1,p'` ge 1.1; then if dpkg --compare-versions `dpkg -s apt |sed -n 's,^Version: \(.*\),\1,p'` ge 1.1; then
apt-get -qy build-dep $CI_PROJECT_DIR $apt_get build-dep $CI_PROJECT_DIR
else else
# this is running on an older version, like jessie-backports # this is running on an older version, like jessie-backports
export BUILD_DEPENDS=`sed 's/\s*|[^,]*,/,/g' debian/control | perl -ne 'next if /^#/; $p=(s/^Build-Depends:\s*/ / or (/^ / and $p)); s/,|\n|\([^)]+\)//mg; print if $p'` export BUILD_DEPENDS=`sed 's/\s*|[^,]*,/,/g' debian/control | perl -ne 'next if /^#/; $p=(s/^Build-Depends:\s*/ / or (/^ / and $p)); s/,|\n|\([^)]+\)//mg; print if $p'`
apt-get -qy install --no-install-recommends \ $apt_get install --no-install-recommends \
build-essential fakeroot git-buildpackage pristine-tar $BUILD_DEPENDS build-essential fakeroot git-buildpackage pristine-tar $BUILD_DEPENDS
fi fi
apt-get -qy autoremove --purge $apt_get autoremove --purge
dpkg-checkbuilddeps dpkg-checkbuilddeps
echo "ensure pristine-tar branch exists and is current" echo "ensure pristine-tar branch exists and is current"
git clean -fdx git clean -fdx