diff options
Diffstat (limited to 'slackupgrade')
-rw-r--r-- | slackupgrade | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/slackupgrade b/slackupgrade index ada387b..30bfa9c 100644 --- a/slackupgrade +++ b/slackupgrade @@ -81,6 +81,11 @@ xfce y " +onexit_remove_list= +function onexit_remove() { + onexit_remove_list="$onexit_remove_list${onexit_remove_list:+ }$1" +} + function tempdir_create() { u=$(umask) umask 077 @@ -89,7 +94,7 @@ function tempdir_create() { } function tempdir_remove() { - rm -rf $tempdir + rm -rf $tempdir $onexit_remove_list } function usage() { @@ -253,11 +258,18 @@ function getfile() { else catfile $1.asc fi) - if [ -n "$ascname" ] \ - && ${GPG:-gpg} --verify $ascname $name 2>/dev/null; then - : - else + if [ -n "$ascname" ]; then + if ! err=$(${GPG:-gpg} --verify $ascname $name 2>&1 >/dev/null) + then + error "$err" error "gpg verification failed for $name" + dropfile $ascname + return + else + dropfile $ascname + fi + else + error "$name: no clearsign signature file found" return fi fi @@ -512,6 +524,7 @@ checksums=$(getfile CHECKSUMS.md5 gpg) if [ -z "$checksums" ]; then abend "CHECKSUMS.md5 not found in $rooturl" fi +onexit_remove $checksums announce=$(tail +13 $checksums | \ sed -n -r\ @@ -523,6 +536,7 @@ file=$(getfile $announce) if [ -z "$file" ]; then abend "file $announce not found in $rooturl" fi +onexit_remove $file newversion=$(echo "$announce" | sed -e 's/\.\/ANNOUNCE\.//' -e 's/_/./g') if [ -z "$newversion" ]; then @@ -651,6 +665,7 @@ if [ $opmode != INCR ]; then if [ -z "$packages" ]; then abend "PACKAGES.TXT not found in $rooturl" fi + onexit_remove $packages download_size=$(sed -n -r \ -e '/PACKAGE NAME:[[:space:]]*/{' \ -e 's///' \ @@ -744,6 +759,7 @@ do if [ -z "$file" ]; then abend "failed to download $pkg" fi + onexit_remove $file pkg_files="$pkg_files${pkg_files:+ }$file" done |