X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Farchival%2Ftest_arch.sh;fp=scripts%2Farchival%2Ftest_arch.sh;h=1a37be2bfdb8f499ad33cf382fd24709af9fade5;hb=0ee49b548b0987edae2e5a19a279c82012923263;hp=be1fddb4d101443412917f56ab03b092fc73c056;hpb=a032348bd89b392e64fd19a409479fa78e9c583d;p=feisty_meow.git diff --git a/scripts/archival/test_arch.sh b/scripts/archival/test_arch.sh index be1fddb4..1a37be2b 100644 --- a/scripts/archival/test_arch.sh +++ b/scripts/archival/test_arch.sh @@ -37,6 +37,7 @@ if [ ! -f "$archive_file" ]; then fi fi +save_err=1 if [[ $archive_file =~ .*\.tar$ \ || $archive_file =~ .*\.tar\.gz$ \ || $archive_file =~ .*\.tar\.bz2$ \ @@ -47,6 +48,7 @@ if [[ $archive_file =~ .*\.tar$ \ || $archive_file =~ .*\.snarf$ \ ]]; then tar -tf $archive_file &>/dev/null + save_err=$? elif [[ $archive_file =~ .*\.zip$ \ || $archive_file =~ .*\.epub$ \ || $archive_file =~ .*\.odt$ \ @@ -54,12 +56,16 @@ elif [[ $archive_file =~ .*\.zip$ \ || $archive_file =~ .*\.war$ \ ]]; then unzip -t $archive_file &>/dev/null -else - # we don't know this as an archive. - exit 0 + save_err=$? +elif [[ "$archive_file" =~ .*\.7z$ ]]; then + 7z t "$archive_file" &>/dev/null + save_err=$? +elif [[ "$archive_file" =~ .*\.rar$ ]]; then + rar t "$archive_file" &>/dev/null + save_err=$? fi -if [ $? -ne 0 ]; then +if [ $save_err -ne 0 ]; then echo "** failure while testing: $archive_file" exit 1 else