2014-05-31 13:50:52 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2014-05-31 13:50:52 +00:00
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
DIB_APT_LOCAL_CACHE=${DIB_APT_LOCAL_CACHE:-1}
|
|
|
|
|
|
|
|
if [ $DIB_APT_LOCAL_CACHE = "0" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2015-01-13 22:22:10 +00:00
|
|
|
apt_cache_dir=$DIB_IMAGE_CACHE/apt/$DISTRO_NAME
|
2014-05-31 13:50:52 +00:00
|
|
|
if [ ! -d $apt_cache_dir ]; then
|
|
|
|
mkdir -p $apt_cache_dir
|
|
|
|
fi
|
|
|
|
sudo mount --bind $apt_cache_dir $TARGET_ROOT/var/cache/apt/archives
|