[Qa-jenkins-scm] [jenkins.debian.net] 01/02: g-i: delete tarball if it fails to extract

Holger Levsen holger at moszumanska.debian.org
Sun May 3 14:11:55 UTC 2015


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

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

commit 934c8ecf332f6f03529d5ba3cadc71d597bfdf6c
Author: Steven Chamberlain <steven at pyro.eu.org>
Date:   Sun May 3 14:30:53 2015 +0100

    g-i: delete tarball if it fails to extract
---
 bin/g-i-installation.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh
index e845356..83ce9ca 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...

-- 
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