summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2010-09-26 11:55:07 +0200
committerDaniel Baumann <daniel@debian.org>2010-09-26 11:55:07 +0200
commitd47773e7d74d26c62d451e3ce950cdaf7749e09c (patch)
tree64ce640dd27515f65dd3cc6d852128d0ec10e392
parent113ddd069dda19136bdd51d79eca25a8dfbee776 (diff)
downloadvyos-live-build-tmp-cache.tar.gz
vyos-live-build-tmp-cache.zip
Updating.tmp-cache
-rwxr-xr-xfunctions/cache.sh5
-rwxr-xr-xfunctions/exit.sh8
2 files changed, 13 insertions, 0 deletions
diff --git a/functions/cache.sh b/functions/cache.sh
index bae606dd2..72e6d5d15 100755
--- a/functions/cache.sh
+++ b/functions/cache.sh
@@ -25,6 +25,9 @@ Restore_cache ()
# without hardlinks
cp "${DIRECTORY}"/*.deb chroot/var/cache/apt/archives
fi
+
+ mkdir -p .stage
+ touch .stage/cache_$(echo ${DIRECTORY} | sed -e 's|/|_|g')
fi
fi
}
@@ -58,4 +61,6 @@ Save_cache ()
# Purging current cache
rm -f chroot/var/cache/apt/archives/*.deb
fi
+
+ rm -f .stage/cache_$(echo ${DIRECTORY} | sed -e 's|/|_|g')
}
diff --git a/functions/exit.sh b/functions/exit.sh
index 5fa1fa86f..575da9b5a 100755
--- a/functions/exit.sh
+++ b/functions/exit.sh
@@ -35,6 +35,14 @@ Exit ()
done
fi
+ # Saving package cache
+ if ls .stage/cache_* > /dev/null 2>&1
+ then
+ _CACHE="$(basename .stage/cache_* | sed -e 's|cache_||' -e 's|_|/|g')"
+
+ Save_cache ${_CACHE}
+ fi
+
return ${VALUE}
}