summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_setup_archlinux_schroot.sh
diff options
context:
space:
mode:
authorkpcyrd <git@rxv.cc>2017-11-02 16:07:01 +0100
committerMattia Rizzolo <mattia@debian.org>2017-11-02 16:46:37 +0100
commit2bc8dddbba45c1985def9fa84a881ce70748b050 (patch)
tree793b214431a4c0bd2a022853ec3fb982afc4293f /bin/reproducible_setup_archlinux_schroot.sh
parent3fa942e3e83f4e3cff990978a95666001f09b002 (diff)
downloadjenkins.debian.net-2bc8dddbba45c1985def9fa84a881ce70748b050.tar.xz
reproducible-archlinux: Try to fix tar extraction
Diffstat (limited to 'bin/reproducible_setup_archlinux_schroot.sh')
-rwxr-xr-xbin/reproducible_setup_archlinux_schroot.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/bin/reproducible_setup_archlinux_schroot.sh b/bin/reproducible_setup_archlinux_schroot.sh
index d4d914ff..c2485ce6 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__