Add switch to turn on caching for debian element.

DIB_OFFLINE has wide-ranging effect. This patch adds a tunable that
only turns on the tarball-caching behaviour specifically for the
debian element.

Change-Id: Idd646d7909df6907afc0eeeec1129c3f1a1f92bc
This commit is contained in:
Jan Grant 2014-04-09 15:31:57 +01:00
parent 95cdefebf6
commit fe33d34637
2 changed files with 5 additions and 1 deletions

View File

@ -10,3 +10,7 @@ and pass it in via `DIB_DISTRIBUTION_MIRROR`.
Use of this element will also require the tool 'debootstrap' to be
available on your system. It should be available on Ubuntu, Debian,
and Fedora.
The `DIB_OFFLINE` or more specific `DIB_DEBIAN_USE_DEBOOTSTRAP_CACHE`
variables can be set to prefer the use of a pre-cached root filesystem
tarball.

View File

@ -32,7 +32,7 @@ DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-http://http.debian.net/debian
http_proxy=${http_proxy:-}
set -x
if [ -n "$DIB_OFFLINE" ] && [ -f $DEBOOTSTRAP_TARBALL ] ; then
if [ -n "$DIB_OFFLINE" -o -n "${DIB_DEBIAN_USE_DEBOOTSTRAP_CACHE:-}" ] && [ -f $DEBOOTSTRAP_TARBALL ] ; then
echo $DEBOOTSTRAP_TARBALL found in cache. Using.
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DEBOOTSTRAP_TARBALL
else