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:
parent
f84c7aaec1
commit
3fa250a25b
|
|
@ -11,23 +11,28 @@ if [[ ! -f $lockfile ]] ; then
|
|||
set -e
|
||||
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
|
||||
sed -i "s, testing , $DEBIAN_RELEASE ," /etc/apt/sources.list
|
||||
fi
|
||||
|
||||
apt-get -qy update
|
||||
apt-get -qy dist-upgrade
|
||||
$apt_get update
|
||||
$apt_get dist-upgrade
|
||||
|
||||
cd $CI_PROJECT_DIR
|
||||
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
|
||||
# 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'`
|
||||
apt-get -qy install --no-install-recommends \
|
||||
$apt_get install --no-install-recommends \
|
||||
build-essential fakeroot git-buildpackage pristine-tar $BUILD_DEPENDS
|
||||
fi
|
||||
apt-get -qy autoremove --purge
|
||||
$apt_get autoremove --purge
|
||||
dpkg-checkbuilddeps
|
||||
echo "ensure pristine-tar branch exists and is current"
|
||||
git clean -fdx
|
||||
|
|
|
|||
Loading…
Reference in New Issue