.zip file is expanded into its own subdirectory
authorshort <>
Tue, 9 Oct 2001 22:50:31 +0000 (22:50 +0000)
committershort <>
Tue, 9 Oct 2001 22:50:31 +0000 (22:50 +0000)
 - direct rewrite from "rpmx", TODO: unify "unzipx" and "rpmx"!

bin/unzipx [new file with mode: 0755]

diff --git a/bin/unzipx b/bin/unzipx
new file mode 100755 (executable)
index 0000000..8e988d7
--- /dev/null
@@ -0,0 +1,21 @@
+#! /bin/sh
+if [ $# = 0 ];then
+       echo 'Syntax: $0 <file.zip>...'
+       exit 1
+       fi
+while [ $# -gt 0 ];do
+       d=`basename "$1" .zip`
+       if [ -f "$d" ];then
+               d="$d.dir"
+               fi
+       mkdir "$d" 2>/dev/null
+       r="$1"
+       if [ "${r#/}" = "$r" ];then
+               r="../$r"
+               fi
+       (if cd "$d";then
+               unzip -L "$r"
+               fi
+        )
+       shift
+       done