Merge "Add element to modify /etc/apt/sources.list in dib"

This commit is contained in:
Jenkins 2013-12-19 11:01:13 +00:00 committed by Gerrit Code Review
commit c1eb44c9b2
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,15 @@
Override the default sources.list
For Ubuntu OS, if your network connection is slow for the default sources.list,
you can define DIB_APT_SOURCES with your favorite sources.list to override it,
before running devtest.sh.
The new sources.list will take effect at build time and run time.
If you want to use this element in tripleo project, set NODE_DIST or
EXTRA_ELEMENTS / UNDERCLOUD_DIB_EXTRA_ARGS / OVERCLOUD_DIB_EXTRA_ARGS
to make it take effect at build time and run time.
e.g. before running devtest.sh:
export DIB_APT_SOURCES=/etc/apt/sources.list
export NODE_DIST="ubuntu apt-sources"

View File

@ -0,0 +1,25 @@
#!/bin/bash
# Override the default /etc/apt/sources.list with $DIB_APT_SOURCES
set -e
# get the cloudimg version
source $TMP_MOUNT_PATH/etc/lsb-release
echo "Current cloudimg codename is: $DISTRIB_DESCRIPTION $DISTRIB_CODENAME"
# exit directly if DIB_APT_SOURCES is not defined properly
if [ -z "$DIB_APT_SOURCES" ] ; then
echo "DIB_APT_SOURCES must be set to the location of a sources.list file you wish to use"
exit 1
elif [ ! -f "$DIB_APT_SOURCES" -o ! -s "$DIB_APT_SOURCES" ] ; then
echo "$DIB_APT_SOURCES is not a valid sources.list file."
echo "You should assign proper sources.list file in DIB_APT_SOURCES"
exit 1
fi
DIB_APT_SOURCES=`readlink -f $DIB_APT_SOURCES`
# copy the sources.list to cloudimg
pushd $TMP_MOUNT_PATH/etc/apt/
sudo cp -f $DIB_APT_SOURCES sources.list
popd