summaryrefslogtreecommitdiff
path: root/helpers/lh_bootstrap_cache
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:05:21 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:26 +0100
commit63631975b71ac083c07fd927d0b7264af73f2e24 (patch)
treed101839dcaff407f24698ac3bc111fe311dd0d5e /helpers/lh_bootstrap_cache
parentba2322bb2b453a848dccb7f80fbe5d72b373926e (diff)
downloadvyos-live-build-63631975b71ac083c07fd927d0b7264af73f2e24.tar.gz
vyos-live-build-63631975b71ac083c07fd927d0b7264af73f2e24.zip
Adding live-helper 1.0~a27-1.
Diffstat (limited to 'helpers/lh_bootstrap_cache')
-rwxr-xr-xhelpers/lh_bootstrap_cache73
1 files changed, 37 insertions, 36 deletions
diff --git a/helpers/lh_bootstrap_cache b/helpers/lh_bootstrap_cache
index 8d811a92f..b253b5d1c 100755
--- a/helpers/lh_bootstrap_cache
+++ b/helpers/lh_bootstrap_cache
@@ -37,49 +37,50 @@ Echo_message "Begin caching bootstrap stage..."
for STAGE in ${LH_CACHE_STAGES}
do
- case "${1}" in
- restore)
- # Checking stage file
- Check_stagefile .stage/bootstrap_cache.restore
+ if [ "${STAGE}" = "bootstrap" ]
+ then
+ case "${1}" in
+ restore)
+ # Checking stage file
+ Check_stagefile .stage/bootstrap_cache.restore
+
+ if [ -d cache/stages_bootstrap ]
+ 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}" = "bootstrap" ] && [ -d cache/stages_bootstrap ]
- then
- # Removing old chroot
- rm -rf chroot
+ # Restoring old cache
+ ${LH_ROOT_COMMAND} cp -a cache/stages_bootstrap chroot
- # Restoring old cache
- ${LH_ROOT_COMMAND} cp -a cache/stages_bootstrap 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/bootstrap_cache.restore
+ Create_stagefile .stage/bootstrap
- # Creating stage file
- Create_stagefile .stage/bootstrap_cache.restore
-
- exit 0
- fi
- ;;
+ exit 0
+ fi
+ ;;
- save)
- # Checking stage file
- Check_stagefile .stage/bootstrap_cache.save
+ save)
+ # Checking stage file
+ Check_stagefile .stage/bootstrap_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}" = "bootstrap" ]
- then
rm -rf cache/stages_bootstrap
mkdir -p cache
@@ -93,7 +94,7 @@ do
# Creating stage file
Create_stagefile .stage/bootstrap_cache.save
- fi
- ;;
- esac
+ ;;
+ esac
+ fi
done