From b56661fead638d40eaee54d9134063098e4fa51c Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Sun, 26 Jan 2014 11:47:48 +0000 Subject: [PATCH] lxc-download: Tweak cache location MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Also include the variant in the path - Fix invalid LXC_CACHE_BASE - Drop redundant code Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- templates/lxc-download.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/lxc-download.in b/templates/lxc-download.in index 3b1d9f93f..3ef9fba82 100644 --- a/templates/lxc-download.in +++ b/templates/lxc-download.in @@ -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..." -- 2.47.2