better naming.
authorChris Koeritz <fred@gruntose.com>
Sun, 30 Sep 2012 23:07:40 +0000 (19:07 -0400)
committerChris Koeritz <fred@gruntose.com>
Sun, 30 Sep 2012 23:07:40 +0000 (19:07 -0400)
scripts/archival/unpack.sh

index 744d354880bb8c7e472c3615cc0ff3b940ce584f..965928c7a065f26a364c080a5f3d8fa4d0eb64b3 100644 (file)
@@ -25,7 +25,8 @@ if [ ! -f "$archive_file" ]; then
 fi
 unpack_dir="$1"; shift
 if [ -z "$unpack_dir" ]; then
-  unpack_dir=$(echo arch_$(basename $archive_file) | sed -e 's/^\([^\.]*\)\..*/\1/')
+  all_but_last="$(echo "$(basename $archive_file)" | sed -e 's/\([\^.]*\)\.[^\.]*$/\1/')"
+  unpack_dir="arch_${all_but_last}"
 fi
 
 if [ ! -d "$unpack_dir" ]; then