Use DIB_IMAGE_CACHE in dpkg element

The dpkg element was hardcoding ~/.cache/image-create as the cache path,
but elements should use DIB_IMAGE_CACHE as the root for the cache to
allow users to override the path. Replace the hardcoded path with one
that is rooted at $DIB_IMAGE_CACHE.

Change-Id: I76030654e7dfc7b7d4dfa87e082c14e7cee479b9
This commit is contained in:
Clark Boylan 2015-01-13 14:22:10 -08:00
parent af4b290328
commit bab9595524
2 changed files with 2 additions and 2 deletions

View File

@ -14,6 +14,6 @@ The dpkg specific version of install-packages is also kept here.
added to the key ring before any apt-get commands take place. added to the key ring before any apt-get commands take place.
* DIB\_APT\_LOCAL\_CACHE: You can use this variable to disable the internal cache * DIB\_APT\_LOCAL\_CACHE: You can use this variable to disable the internal cache
of the /var/cache/apt/archives directory by setting it to 0. The default is to bind of the /var/cache/apt/archives directory by setting it to 0. The default is to bind
mount the ~/.cache/image-create/apt/$DISTRO_NAME directory in mount the $DIB_IMAGE_CACHE/apt/$DISTRO_NAME directory in
/var/cache/apt/archives, this to cache the .deb files downloaded during the image /var/cache/apt/archives, this to cache the .deb files downloaded during the image
creation. creation.

View File

@ -9,7 +9,7 @@ if [ $DIB_APT_LOCAL_CACHE = "0" ]; then
exit 0 exit 0
fi fi
apt_cache_dir=$HOME/.cache/image-create/apt/$DISTRO_NAME apt_cache_dir=$DIB_IMAGE_CACHE/apt/$DISTRO_NAME
if [ ! -d $apt_cache_dir ]; then if [ ! -d $apt_cache_dir ]; then
mkdir -p $apt_cache_dir mkdir -p $apt_cache_dir
fi fi