2013-12-17 10:19:21 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Override the default /etc/apt/sources.list with $DIB_APT_SOURCES
|
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2014-04-03 02:24:15 +00:00
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
2013-12-17 10:19:21 +00:00
|
|
|
|
|
|
|
# exit directly if DIB_APT_SOURCES is not defined properly
|
2015-02-03 07:17:00 +00:00
|
|
|
if [ -z "${DIB_APT_SOURCES:-}" ] ; then
|
2013-12-17 10:19:21 +00:00
|
|
|
echo "DIB_APT_SOURCES must be set to the location of a sources.list file you wish to use"
|
2015-02-03 07:17:00 +00:00
|
|
|
exit 0
|
2013-12-17 10:19:21 +00:00
|
|
|
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
|