fixes from nasty path code.
[feisty_meow.git] / scripts / archival / unpack.sh
index de82c021e29a2b717c0cb61f8c65d01a4012e812..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 unpacked_$(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