summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_setup_archlinux_schroot.sh
diff options
context:
space:
mode:
authorkpcyrd <git@rxv.cc>2017-11-02 13:45:04 +0100
committerMattia Rizzolo <mattia@debian.org>2017-11-02 14:46:48 +0100
commit1ca10cdf644e9612275fa17b09c2b2380d131681 (patch)
treef51c31dce03d0c263035c1652c696752ab8fc57f /bin/reproducible_setup_archlinux_schroot.sh
parent2952f3ee1945b47a83784cd85c20e32d27a267b1 (diff)
downloadjenkins.debian.net-1ca10cdf644e9612275fa17b09c2b2380d131681.tar.xz
reproducible archlinux: fix sha1sums parsing
Diffstat (limited to 'bin/reproducible_setup_archlinux_schroot.sh')
-rwxr-xr-xbin/reproducible_setup_archlinux_schroot.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/reproducible_setup_archlinux_schroot.sh b/bin/reproducible_setup_archlinux_schroot.sh
index c3c8beb6..d4d914ff 100755
--- a/bin/reproducible_setup_archlinux_schroot.sh
+++ b/bin/reproducible_setup_archlinux_schroot.sh
@@ -8,6 +8,8 @@
# then configures pacman and abs
#
+set -e
+
DEBUG=true
. /srv/jenkins/bin/common-functions.sh
common_init "$@"
@@ -20,17 +22,17 @@ ARCHLINUX_MIRROR=http://mirror.one.com/archlinux/
bootstrap() {
# define URL for bootstrap.tgz
- BOOTSTRAP_BASE=$ARCHLINUX_MIRROR/iso/
+ BOOTSTRAP_BASE="$ARCHLINUX_MIRROR/iso/"
echo "$(date -u) - downloading Arch Linux latest/sha1sums.txt"
- BOOTSTRAP_DATE=$(curl $BOOTSTRAP_BASE/latest/sha1sums.txt 2>/dev/null| grep x86_64.tar.gz| cut -d " " -f3|cut -d "-" -f3|egrep '[0-9.]{9}')
+ BOOTSTRAP_DATE=$(curl -sSf $BOOTSTRAP_BASE/latest/sha1sums.txt | grep x86_64.tar.gz | cut -d " " -f3 | cut -d "-" -f3 | egrep -o '[0-9.]{10}')
if [ -z $BOOTSTRAP_DATE ] ; then
echo "Cannot determine version of boostrap file, aborting."
- curl $BOOTSTRAP_BASE/latest/sha1sums.txt | grep x86_64.tar.gz
+ 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
+ BOOTSTRAP_TAR_GZ="$BOOTSTRAP_DATE/archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz"
echo "$(date -u) - downloading Arch Linux bootstrap.tar.gz."
- curl -O $BOOTSTRAP_BASE/$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