diff options
author | Daniel Baumann <daniel@debian.org> | 2007-09-23 10:05:21 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:22:26 +0100 |
commit | 63631975b71ac083c07fd927d0b7264af73f2e24 (patch) | |
tree | d101839dcaff407f24698ac3bc111fe311dd0d5e /helpers/lh_chroot_cache | |
parent | ba2322bb2b453a848dccb7f80fbe5d72b373926e (diff) | |
download | live-build-63631975b71ac083c07fd927d0b7264af73f2e24.zip live-build-63631975b71ac083c07fd927d0b7264af73f2e24.tar.gz |
Adding live-helper 1.0~a27-1.
Diffstat (limited to 'helpers/lh_chroot_cache')
-rwxr-xr-x | helpers/lh_chroot_cache | 75 |
1 files changed, 39 insertions, 36 deletions
diff --git a/helpers/lh_chroot_cache b/helpers/lh_chroot_cache index 157a48e..4ec2d13 100755 --- a/helpers/lh_chroot_cache +++ b/helpers/lh_chroot_cache @@ -37,49 +37,49 @@ Echo_message "Begin caching chroot stage..." for STAGE in ${LH_CACHE_STAGES} do - case "${1}" in - restore) - # Checking stage file - Check_stagefile .stage/chroot_cache.restore + if [ "${STAGE}" = "chroot" ] + then + case "${1}" in + restore) + # Checking stage file + Check_stagefile .stage/chroot_cache.restore + + if [ -d cache/stages_chroot ] + then + # Checking lock file + Check_lockfile .lock - # Checking lock file - Check_lockfile .lock + # Creating lock file + Create_lockfile .lock - # Creating lock file - Create_lockfile .lock + # Removing old chroot + rm -rf chroot - if [ "${STAGE}" = "chroot" ] && [ -d cache/stages_chroot ] - then - # Removing old chroot - rm -rf chroot + # Restoring old cache + ${LH_ROOT_COMMAND} cp -a cache/stages_chroot chroot - # Restoring old cache - ${LH_ROOT_COMMAND} cp -a cache/stages_chroot chroot + if [ -n "${LH_ROOT_COMMAND}" ] + then + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` chroot + fi - if [ -n "${LH_ROOT_COMMAND}" ] - then - ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` chroot - fi + # Creating stage file + Create_stagefile .stage/chroot_cache.restore - # Creating stage file - Create_stagefile .stage/chroot_cache.restore - - exit 0 - fi - ;; + exit 0 + fi + ;; - save) - # Checking stage file - Check_stagefile .stage/chroot_cache.save + save) + # Checking stage file + Check_stagefile .stage/chroot_cache.save - # Checking lock file - Check_lockfile .lock + # Checking lock file + Check_lockfile .lock - # Creating lock file - Create_lockfile .lock + # Creating lock file + Create_lockfile .lock - if [ "${STAGE}" = "chroot" ] - then rm -rf cache/stages_chroot mkdir -p cache @@ -90,7 +90,10 @@ do then ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` cache/stages_chroot fi - fi - ;; - esac + + # Creating stage file + Create_stagefile .stage/chroot_cache.save + ;; + esac + fi done |