r68226 - /scripts/repack.sh

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Wed Feb 9 16:34:10 UTC 2011


Author: gregoa
Date: Wed Feb  9 16:33:59 2011
New Revision: 68226

URL: http://svn.debian.org/wsvn/?sc=1&rev=68226
Log:
add support for .zip/.jar; bump REPACK_VERSION

Modified:
    scripts/repack.sh

Modified: scripts/repack.sh
URL: http://svn.debian.org/wsvn/scripts/repack.sh?rev=68226&op=diff
==============================================================================
--- scripts/repack.sh (original)
+++ scripts/repack.sh Wed Feb  9 16:33:59 2011
@@ -12,7 +12,6 @@
 # de-uglify libsyntax-highlight-engine-kate-perl.
 # TODO: have each mv and rm check that something actually changed, and
 # if not, die
-# TODO: add support for .zip?
 
 set -e
 set -u
@@ -51,7 +50,7 @@
 # Create an extra directory to cope with rootless tarballs
 UP_BASE="$DIR/unpack"
 mkdir "$UP_BASE"
-tar xf "$FILE" -C "$UP_BASE"
+tar xf "$FILE" -C "$UP_BASE" || unzip "$FILE" -d "$UP_BASE"
 
 if [ `ls -1 "$UP_BASE" | wc -l` -eq 1 ]; then
 	# Tarball does contain a root directory
@@ -112,7 +111,7 @@
 }
 
 # bump with incompatible changes
-REPACK_VERSION=2
+REPACK_VERSION=3
 
 requires_version(){
     if [ $REPACK_VERSION -lt $1 ]; then
@@ -139,7 +138,7 @@
 # .gz or .bz2?
 FILETYPE=$(file --brief --mime-type --dereference "$FILE")
 case "$FILETYPE" in
-    application/x-gzip)
+    application/x-gzip|application/zip)
         C_PROGRAM="gzip"
         C_SUFFIX="gz"
         ;;




More information about the Pkg-perl-cvs-commits mailing list