projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new fortune.
[feisty_meow.git]
/
scripts
/
archival
/
unpack.sh
diff --git
a/scripts/archival/unpack.sh
b/scripts/archival/unpack.sh
index 103ec1932b66269da79ae19724c773a8ae357886..6670f489f8b408da83baa6983006bd1cb0a398d6 100644
(file)
--- a/
scripts/archival/unpack.sh
+++ b/
scripts/archival/unpack.sh
@@
-20,12
+20,13
@@
if [ -z "$archive_file" ]; then
exit 1
fi
if [ ! -f "$archive_file" ]; then
exit 1
fi
if [ ! -f "$archive_file" ]; then
- echo "The file specified
for unpacking
cannot be located: $archive_file"
+ echo "The file specified cannot be located: $archive_file"
exit 1
fi
unpack_dir="$1"; shift
if [ -z "$unpack_dir" ]; then
exit 1
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
fi
if [ ! -d "$unpack_dir" ]; then
@@
-57,6
+58,8
@@
if [[ $archive_file =~ .*\.tar$ \
|| $archive_file =~ .*\.iar$ \
|| $archive_file =~ .*\.oar$ \
|| $archive_file =~ .*\.tgz$ \
|| $archive_file =~ .*\.iar$ \
|| $archive_file =~ .*\.oar$ \
|| $archive_file =~ .*\.tgz$ \
+ || $archive_file =~ .*\.ova$ \
+ || $archive_file =~ .*\.snarf$ \
]]; then
tar -xf $archive_file &>/dev/null
elif [[ $archive_file =~ .*\.zip$ \
]]; then
tar -xf $archive_file &>/dev/null
elif [[ $archive_file =~ .*\.zip$ \