From 5603355e1d2db03c53bcfa370bba5f9220b2a19e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 4 Nov 2013 13:44:39 +0100 Subject: Handling bootstrap cache inside the bootstrap stubs itself. --- components/bootstrap_debootstrap | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'components/bootstrap_debootstrap') diff --git a/components/bootstrap_debootstrap b/components/bootstrap_debootstrap index 2f5c128e7..0d76d627d 100755 --- a/components/bootstrap_debootstrap +++ b/components/bootstrap_debootstrap @@ -111,6 +111,20 @@ def main(): sys.exit(1) + # stage cache + if os.path.exists('cache/bootstrap'): + if verbose: + print('I: Copying cache/bootstrap to chroot') + + # Notes: + # * there's no Python equivalent to 'cp -a' that handels both symlinks and device nodes properly. + cache = subprocess.call('cp -a cache/bootstrap chroot', shell=True) + + os.makedirs('.build', exist_ok=True) + open('.build/bootstrap', 'w').close() + + sys.exit(0) + # packages cache if glob.glob('cache/packages.bootstrap/*.deb'): if verbose: @@ -148,6 +162,15 @@ def main(): for package in glob.glob('chroot/var/cache/apt/archives/*.deb'): shutil.move(package, 'cache/packages.bootstrap') + # stage cache + if not os.path.exists('cache/bootstrap'): + if verbose: + print('I: Copying chroot to cache/bootstrap') + + # Notes: + # * there's no Python equivalent to 'cp -a' that handels both symlinks and device nodes properly. + cache = subprocess.call('cp -a chroot cache/bootstrap', shell=True) + ## stagefile os.makedirs('.build', exist_ok=True) open('.build/bootstrap', 'w').close() -- cgit v1.2.3