projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updating cakephp apps
[feisty_meow.git]
/
scripts
/
archival
/
list_arch.sh
diff --git
a/scripts/archival/list_arch.sh
b/scripts/archival/list_arch.sh
index eba1fc8f4e4fa7afc76227d866b63a45414228ab..82e6fb7ecdb5a19708ceadf3380b534d4975c409 100644
(file)
--- a/
scripts/archival/list_arch.sh
+++ b/
scripts/archival/list_arch.sh
@@
-13,6
+13,8
@@
# An arbitrary format archive lister, although really we are mainly supporting
# tar and zip currently, including compressed formats.
# An arbitrary format archive lister, although really we are mainly supporting
# tar and zip currently, including compressed formats.
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+
archive_file="$1"; shift
if [ -z "$archive_file" ]; then
echo "This script takes one archive name (in .tar.gz, .zip, etc. formats) and"
archive_file="$1"; shift
if [ -z "$archive_file" ]; then
echo "This script takes one archive name (in .tar.gz, .zip, etc. formats) and"
@@
-25,9
+27,9
@@
if [ ! -f "$archive_file" ]; then
fi
if [ -z "$PAGER" ]; then
fi
if [ -z "$PAGER" ]; then
- PAGER=$(which less)
+ PAGER=$(which
able
less)
if [ -z "$PAGER" ]; then
if [ -z "$PAGER" ]; then
- PAGER=$(which more)
+ PAGER=$(which
able
more)
if [ -z "$PAGER" ]; then
PAGER="cat"
fi
if [ -z "$PAGER" ]; then
PAGER="cat"
fi
@@
-47,6
+49,7
@@
if [ ! -f "$archive_file" ]; then
fi
fi
fi
fi
+save_err=1
if [[ $archive_file =~ .*\.tar$ \
|| $archive_file =~ .*\.tar\.gz$ \
|| $archive_file =~ .*\.tar\.bz2$ \
if [[ $archive_file =~ .*\.tar$ \
|| $archive_file =~ .*\.tar\.gz$ \
|| $archive_file =~ .*\.tar\.bz2$ \
@@
-57,6
+60,7
@@
if [[ $archive_file =~ .*\.tar$ \
|| $archive_file =~ .*\.snarf$ \
]]; then
tar -tf $archive_file | $PAGER
|| $archive_file =~ .*\.snarf$ \
]]; then
tar -tf $archive_file | $PAGER
+ save_err=${PIPESTATUS[0]}
elif [[ $archive_file =~ .*\.zip$ \
|| $archive_file =~ .*\.epub$ \
|| $archive_file =~ .*\.odt$ \
elif [[ $archive_file =~ .*\.zip$ \
|| $archive_file =~ .*\.epub$ \
|| $archive_file =~ .*\.odt$ \
@@
-64,4
+68,17
@@
elif [[ $archive_file =~ .*\.zip$ \
|| $archive_file =~ .*\.war$ \
]]; then
unzip -v $archive_file | $PAGER
|| $archive_file =~ .*\.war$ \
]]; then
unzip -v $archive_file | $PAGER
+ save_err=${PIPESTATUS[0]}
+elif [[ "$archive_file" =~ .*\.7z$ ]]; then
+ 7z l "$archive_file" | $PAGER
+ save_err=${PIPESTATUS[0]}
+elif [[ "$archive_file" =~ .*\.rar$ ]]; then
+ rar l "$archive_file" | $PAGER
+ save_err=${PIPESTATUS[0]}
fi
fi
+
+if [ $save_err -ne 0 ]; then
+ echo "There was a failure reported while listing: $archive_file"
+ exit 1
+fi
+