diff --git a/tests/fixtures/ipsum.txt.gzip b/tests/fixtures/ipsum.txt.gzip new file mode 100644 index 0000000..63d02a5 Binary files /dev/null and b/tests/fixtures/ipsum.txt.gzip differ diff --git a/tests/test_file_extract.sh b/tests/test_file_extract.sh index 9316957..2efe11b 100755 --- a/tests/test_file_extract.sh +++ b/tests/test_file_extract.sh @@ -5,7 +5,7 @@ test_file_extract() { - for name in gz bz2 lzma xz + for name in gz bz2 lzma xz gzip do echo "Testing ${name}" extract_archive $name @@ -14,6 +14,7 @@ test_file_extract() { extract_archive() { ext=$1 cd $SHUNIT_TMPDIR + $PROGRAM $FIXTURES/ipsum.txt.${ext} > /dev/null result_val=$? diff --git a/unfoo b/unfoo index 2d0537a..0772b18 100755 --- a/unfoo +++ b/unfoo @@ -101,7 +101,7 @@ for i in "$@"; do ;; # tar'd and gzip'd or compress'd - *.tar.gz|*.tgz|*.tar.Z|*.tar.z) + *.tar.gz|*.tgz|*.tar.Z|*.tar.z|*.tZ|*.tz) echo -n "$IAM: Decompressing and unpacking gzip'd tarball $ITIS..." if [ $(tar ft "$i" | need_subdir) == 1 ]; then dirname=$(basename $i | sed -r 's/(.tar.gz|.tgz|.tar.Z|.tar.z)$//g') @@ -173,9 +173,10 @@ for i in "$@"; do ;; # gzip'd or compress'd - *.gz|*.Z|*.z) + *.gz|*.Z|*.z|*.gzip) echo -n "$IAM: Decompressing gzip archive $ITIS..." - gzip -dc "$i" > `basename "$i" .gz` + filename=$(basename $i | sed -r 's/(.gz|.gzip)$//g') + gzip -dc "$i" > $filename check_success ;;