]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-download: Tweak cache location
authorStéphane Graber <stgraber@ubuntu.com>
Sun, 26 Jan 2014 11:47:48 +0000 (11:47 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 27 Jan 2014 09:43:56 +0000 (09:43 +0000)
 - Also include the variant in the path
 - Fix invalid LXC_CACHE_BASE
 - Drop redundant code

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-download.in

index 3b1d9f93f6d950771886057b21240e9373c1fb7f..3ef9fba8202f14cb2ac5f35d8b8bacdc2d66d141 100644 (file)
@@ -327,15 +327,15 @@ fi
 
 # Setup the cache
 if [ "$DOWNLOAD_MODE" = "system" ]; then
-    LXC_CACHE_BASE="$LOCALSTATEDIR/cache/"
-    LXC_CACHE_PATH="$LOCALSTATEDIR/cache/lxc/download/$DOWNLOAD_DIST"
-    LXC_CACHE_PATH="$LXC_CACHE_PATH/$DOWNLOAD_RELEASE/$DOWNLOAD_ARCH"
+    LXC_CACHE_BASE="$LOCALSTATEDIR/cache/lxc/"
 else
     LXC_CACHE_BASE="$HOME/.cache/lxc/"
-    LXC_CACHE_PATH="$HOME/.cache/lxc/download/$DOWNLOAD_DIST"
-    LXC_CACHE_PATH="$LXC_CACHE_PATH/$DOWNLOAD_RELEASE/$DOWNLOAD_ARCH"
 fi
 
+LXC_CACHE_PATH="$LXC_CACHE_BASE/download/$DOWNLOAD_DIST"
+LXC_CACHE_PATH="$LXC_CACHE_PATH/$DOWNLOAD_RELEASE/$DOWNLOAD_ARCH/"
+LXC_CACHE_PATH="$LXC_CACHE_PATH/$DOWNLOAD_VARIANT"
+
 if [ -d "$LXC_CACHE_PATH" ]; then
     if [ "$DOWNLOAD_FLUSH_CACHE" = "true" ]; then
         echo "Flushing the cache..."