summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Chamberlain <steven@pyro.eu.org>2015-05-03 14:30:53 +0100
committerHolger Levsen <holger@layer-acht.org>2015-05-03 16:11:28 +0200
commit934c8ecf332f6f03529d5ba3cadc71d597bfdf6c (patch)
tree0905b5e6c3faddd292df4ced0c3909e805977c01
parent5d51da46d2fa84d5db4d0faa644b71fddd01cb64 (diff)
downloadjenkins.debian.net-934c8ecf332f6f03529d5ba3cadc71d597bfdf6c.tar.xz
g-i: delete tarball if it fails to extract
-rwxr-xr-xbin/g-i-installation.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh
index e845356a..83ce9ca9 100755
--- a/bin/g-i-installation.sh
+++ b/bin/g-i-installation.sh
@@ -1275,9 +1275,13 @@ if [ ! -z "$NETBOOT" ] ; then
# if there is a netboot installer tarball...
#
fetch_if_newer "$NETBOOT" "$URL"
- # try to extract, otherwise abort
sha256sum "$NETBOOT"
- tar -zxvf "$NETBOOT" || exit
+ # try to extract, otherwise clean up and abort
+ if ! tar -zxvf "$NETBOOT" ; then
+ echo "tarball seems corrupt; deleting it"
+ rm -f "$NETBOOT"
+ exit 1
+ fi
elif [ ! -z "$IMAGE" ] ; then
#
# if there is a CD image...