# HG changeset patch # User Paul Boddie # Date 1421353508 -3600 # Node ID bcc54eac43e9f24ce3a9624b6767a2a15bb91823 # Parent 66e1c5bb8c7839bf465aad37b4964ebf99b07f91 Handled archive downloading and unpacking failures. diff -r 66e1c5bb8c78 -r bcc54eac43e9 uml-linux-build --- a/uml-linux-build Thu Jan 15 21:24:42 2015 +0100 +++ b/uml-linux-build Thu Jan 15 21:25:08 2015 +0100 @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2011, 2012, 2013 Paul Boddie +# Copyright (C) 2011, 2012, 2013, 2014 Paul Boddie # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -40,11 +40,20 @@ if [ ! -e "$LINUXDIRNAME" ]; then if [ ! -e "$LINUXARCHIVE" ]; then echo "Getting the Linux kernel archive..." 1>&2 - wget -O "$LINUXARCHIVE" "$LINUXADDRESS" + if ! wget -O "$LINUXARCHIVE" "$LINUXADDRESS" ; then + echo "Unable to download from URL: $LINUXADDRESS" 1>&2 + exit 1 + fi fi echo "Unpacking the archive..." 1>&2 - tar jxf "$LINUXARCHIVE" + if [ `basename "$LINUXARCHIVE" .bz2` != "$LINUXARCHIVE" ]; then + tar jxf "$LINUXARCHIVE" + elif [ `basename "$LINUXARCHIVE" .gz` != "$LINUXARCHIVE" ]; then + tar zxf "$LINUXARCHIVE" + else + echo "Don't know how to unpack the downloaded file: $LINUXARCHIVE" 1>&2 + fi fi if [ ! -e "$LINUXDIRNAME/linux" ]; then