From 70e84bd3c188e0941a991084469df1407005072c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 Dec 2010 15:33:54 +0100 Subject: Updating bootstrap for multiarch. --- scripts/build/lb_bootstrap_cache | 101 ++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 49 deletions(-) (limited to 'scripts/build/lb_bootstrap_cache') diff --git a/scripts/build/lb_bootstrap_cache b/scripts/build/lb_bootstrap_cache index 755baad01..6672668c7 100755 --- a/scripts/build/lb_bootstrap_cache +++ b/scripts/build/lb_bootstrap_cache @@ -27,68 +27,71 @@ Set_defaults # Check architecture Check_crossarchitectures -Echo_message "Begin caching bootstrap stage..." - -for STAGE in ${LB_CACHE_STAGES} +for _ARCHITECTURE in ${LB_ARCHITECTURES} do - 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 + Echo_message "Begin caching bootstrap stage..." + + for STAGE in ${LB_CACHE_STAGES} + do + if [ "${STAGE}" = "bootstrap" ] + then + case "${1}" in + restore) + # Checking stage file + Check_stagefile .stage/bootstrap_cache.${_ARCHITECTURE}-restore + + if [ -d cache/stages_bootstrap.${_ARCHITECTURE} ] + then + # Checking lock file + Check_lockfile .lock - # Creating lock file - Create_lockfile .lock + # Creating lock file + Create_lockfile .lock - # Removing old chroot - rm -rf chroot + # Removing old chroot + rm -rf chroot.${_ARCHITECTURE} - # Restoring old cache - ${LB_ROOT_COMMAND} cp -a cache/stages_bootstrap chroot + # Restoring old cache + ${LB_ROOT_COMMAND} cp -a cache/stages_bootstrap.${_ARCHITECTURE} chroot.${_ARCHITECTURE} - if [ -n "${LB_ROOT_COMMAND}" ] - then - ${LB_ROOT_COMMAND} chown -R $(whoami):$(whoami) chroot - fi + if [ -n "${LB_ROOT_COMMAND}" ] + then + ${LB_ROOT_COMMAND} chown -R $(whoami):$(whoami) chroot.${_ARCHITECTURE} + fi - # Creating stage file - Create_stagefile .stage/bootstrap_cache.restore - Create_stagefile .stage/bootstrap + # Creating stage file + Create_stagefile .stage/bootstrap_cache.${_ARCHITECTURE}-restore + Create_stagefile .stage/bootstrap.${_ARCHITECTURE} - 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.${_ARCHITECTURE}-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 - rm -rf cache/stages_bootstrap + rm -rf cache/stages_bootstrap.${_ARCHITECTURE} - mkdir -p cache + mkdir -p cache - ${LB_ROOT_COMMAND} cp -a chroot cache/stages_bootstrap + ${LB_ROOT_COMMAND} cp -a chroot.${_ARCHITECTURE} cache/stages_bootstrap.${_ARCHITECTURE} - if [ -n "${LB_ROOT_COMMAND}" ] - then - ${LB_ROOT_COMMAND} chown -R $(whoami):$(whoami) cache/stages_bootstrap - fi + if [ -n "${LB_ROOT_COMMAND}" ] + then + ${LB_ROOT_COMMAND} chown -R $(whoami):$(whoami) cache/stages_bootstrap.${_ARCHITECTURE} + fi - # Creating stage file - Create_stagefile .stage/bootstrap_cache.save - ;; - esac - fi + # Creating stage file + Create_stagefile .stage/bootstrap_cache.${_ARCHITECTURE}-save + ;; + esac + fi + done done -- cgit v1.2.3