Merge "Enable custom apt.conf in apt-conf element"

This commit is contained in:
Jenkins 2014-02-28 04:17:51 +00:00 committed by Gerrit Code Review
commit 142dfad122
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,18 @@
Override the default apt.conf
=============================
For APT based systems, if you require specific options for apt operations,
you can define `DIB_APT_CONF` with your favorite apt.conf to override it,
before running devtest.sh.
The new apt.conf will take effect at build time and run time.
If you want to use this element with tripleo-incubator scripts, set `NODE_DIST`
/ `SEED_DIB_EXTRA_ARGS` / `UNDERCLOUD_DIB_EXTRA_ARGS` /
`OVERCLOUD_CONTROL_DIB_EXTRA_ARGS` / `OVERCLOUD_COMPUTE_DIB_EXTRA_ARGS` to
make it take effect at the appropriate time.
For instance, before running devtest.sh:
export DIB_APT_CONF=/etc/apt/apt.conf
export NODE_DIST="ubuntu apt-conf"

View File

@ -0,0 +1,17 @@
#!/bin/bash
# Override the default /etc/apt/apt.conf with $DIB_APT_CONF
set -eu
# exit directly if DIB_APT_CONF is not defined properly
if [ -z "$DIB_APT_CONF" ] ; then
echo "DIB_APT_CONF is not set - no apt.conf will be copied in"
exit 0
elif [ ! -f "$DIB_APT_CONF" ] ; then
echo "$DIB_APT_CONF is not a valid apt.conf file."
echo "You should assign a proper apt.conf file in DIB_APT_CONF"
exit 1
fi
# copy the apt.conf to cloudimg
sudo cp -L -f $DIB_APT_CONF $TMP_MOUNT_PATH/etc/apt/apt.conf