diff options
Diffstat (limited to 'components')
-rwxr-xr-x | components/bootstrap_cdebootstrap | 23 | ||||
-rwxr-xr-x | components/bootstrap_debootstrap | 23 |
2 files changed, 46 insertions, 0 deletions
diff --git a/components/bootstrap_cdebootstrap b/components/bootstrap_cdebootstrap index fc0b663d6..3ac2b95d6 100755 --- a/components/bootstrap_cdebootstrap +++ b/components/bootstrap_cdebootstrap @@ -106,6 +106,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: @@ -151,6 +165,15 @@ def main(): cdebootstrap = subprocess.call('/usr/bin/cdebootstrap ' + cdebootstrap_options, shell=True) + # 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() 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() |