From c8367a5e68d5021eda4ea6fe28f645006e23b69b Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Tue, 28 Oct 2014 15:18:30 +0000 Subject: [PATCH] Caching debootstrap --- images/lib.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/images/lib.sh b/images/lib.sh index 9f98077..e12dc96 100644 --- a/images/lib.sh +++ b/images/lib.sh @@ -25,16 +25,18 @@ clean_workspace() { } debootstrap() { - sudo debootstrap \ - --arch="$ARCH" \ - --variant="$VARIANT" \ - --components="$COMPONENTS" \ - --include="$PKGS_INCLUDE" \ - --foreign \ - "$VERSION" \ - "$TARGET" \ - "$MIRROR" \ - "$SCRIPT" + if [ ! -d "$TARGET.debootstrap" ]; then + sudo debootstrap \ + --arch="$ARCH" \ + --variant="$VARIANT" \ + --components="$COMPONENTS" \ + --include="$PKGS_INCLUDE" \ + "$VERSION" \ + "$TARGET.debootstrap" \ + "$MIRROR" \ + "$SCRIPT" + fi + rsync -aHAX "$TARGET.debootstrap/" "$TARGET/" } upgrade_debs() { @@ -44,7 +46,8 @@ upgrade_debs() { secondstage() { # This step could be done directly by removing - sudo chroot "$TARGET" /debootstrap/debootstrap --second-stage + # do_in_target /debootstrap/debootstrap --second-stage + echo "Not needed anymore (removed the --foreign option)" } patch_target() {