]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
zipdiff: use a trick from ./all: use BOTH infozip AND 7zip to make best possible...
authorRudolf Polzer <divverent@xonotic.org>
Sun, 11 Mar 2012 15:13:12 +0000 (16:13 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 11 Mar 2012 15:13:12 +0000 (16:13 +0100)
misc/tools/xzipdiff
misc/tools/zipdiff

index 03824bed1a144918570d4e45515f581979391a13..25c85f7c35a5d65440d549466a5e3363fd8d7b5a 100755 (executable)
@@ -33,7 +33,7 @@ makepatchname()
        echo "$prefix$fromversion"patch"$toversion$suffix"
 }
 
-zipdiff -z "zip -9r" -f "$from" -t "$to" -o "$output" -x "$excludes"
+zipdiff -f "$from" -t "$to" -o "$output" -x "$excludes"
 
 tempdir=`mktemp -d -t zipdiff.XXXXXX`
 cd "$tempdir"
@@ -47,7 +47,7 @@ for x in $excludes; do
        patchname=`makepatchname "$x" "$fromname" "$toname"`
        patchdir="c/$patchname"; patchdir=${patchdir%/*}
        mkdir -p "$patchdir"
-       zipdiff -z "zip -9r" -f a/"$fromname" -t b/"$toname" -o c/"$patchname"
+       zipdiff -f a/"$fromname" -t b/"$toname" -o c/"$patchname"
        if [ -f c/"$patchname" ]; then
                (cd c && zip -0r "$output" "$patchname")
        fi
index 4b61c3564be11b00132a2cb38d82578204637d5a..88ea560efb1503b3e913ff56ca62eaff86701314 100755 (executable)
@@ -14,7 +14,19 @@ output=
 from=
 to=
 excludes=
-ziptool="7za a -tzip -mx=9"
+ziptool="mkzip"
+
+mkzip()
+{
+       archive=$1; shift
+       sevenzipflags=-mx=9
+       zipflags=-9
+       ziplist=`mktemp`
+       find "$@" -xtype f \( -executable -or -type l \) -print > "$ziplist"
+       7za a -tzip $sevenzipflags -x@"$ziplist" "$archive" "$@" || true
+       zip         $zipflags -y   -@<"$ziplist" "$archive"      || true
+       rm -f "$ziplist"
+}
 
 while [ $# -gt 0 ]; do
        o=$1