[Qa-jenkins-scm] [jenkins.debian.net] 01/03: reproducible-archlinux: Try to fix tar extraction

Mattia Rizzolo mattia at debian.org
Thu Nov 2 15:52:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository jenkins.debian.net.

commit 2bc8dddbba45c1985def9fa84a881ce70748b050
Author: kpcyrd <git at rxv.cc>
Date:   Thu Nov 2 16:07:01 2017 +0100

    reproducible-archlinux: Try to fix tar extraction
---
 bin/reproducible_setup_archlinux_schroot.sh | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/bin/reproducible_setup_archlinux_schroot.sh b/bin/reproducible_setup_archlinux_schroot.sh
index d4d914f..c2485ce 100755
--- a/bin/reproducible_setup_archlinux_schroot.sh
+++ b/bin/reproducible_setup_archlinux_schroot.sh
@@ -30,12 +30,20 @@ bootstrap() {
 		curl -sSf "$BOOTSTRAP_BASE/latest/sha1sums.txt" | grep x86_64.tar.gz
 		exit 1
 	fi
-	BOOTSTRAP_TAR_GZ="$BOOTSTRAP_DATE/archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz"
-	echo "$(date -u) - downloading Arch Linux bootstrap.tar.gz."
-	curl -fO "$BOOTSTRAP_BASE/$BOOTSTRAP_TAR_GZ"
-	tar xzf archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz -C $SCHROOT_BASE
-	mv $SCHROOT_BASE/root.x86_64 $SCHROOT_BASE/$TARGET
-	rm archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz -rf
+
+    if [ ! -f "archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz" ]; then
+        BOOTSTRAP_TAR_GZ="$BOOTSTRAP_DATE/archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz"
+        echo "$(date -u) - downloading Arch Linux bootstrap.tar.gz."
+
+        curl -fO "$BOOTSTRAP_BASE/$BOOTSTRAP_TAR_GZ"
+        rm -rf --one-file-system "$SCHROOT_BASE/root.x86_64/"
+        tar xzf archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz -C $SCHROOT_BASE
+
+        rm -rf --one-file-system "$SCHROOT_BASE/$TARGET"
+        mv $SCHROOT_BASE/root.x86_64 $SCHROOT_BASE/$TARGET
+        rm archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz -rf
+    fi
+
 	# write the schroot config
 	echo "$(date -u ) - writing schroot configuration for $TARGET."
 	sudo tee /etc/schroot/chroot.d/jenkins-"$TARGET" <<-__END__

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list