From: Rudolf Polzer Date: Sun, 11 Mar 2012 15:13:12 +0000 (+0100) Subject: zipdiff: use a trick from ./all: use BOTH infozip AND 7zip to make best possible... X-Git-Tag: xonotic-v0.7.0~74 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4f8ddad06ad88e29e2e8f01277aeda2d2181e5bb;p=xonotic%2Fxonotic.git zipdiff: use a trick from ./all: use BOTH infozip AND 7zip to make best possible zip file --- diff --git a/misc/tools/xzipdiff b/misc/tools/xzipdiff index 03824bed..25c85f7c 100755 --- a/misc/tools/xzipdiff +++ b/misc/tools/xzipdiff @@ -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 diff --git a/misc/tools/zipdiff b/misc/tools/zipdiff index 4b61c356..88ea560e 100755 --- a/misc/tools/zipdiff +++ b/misc/tools/zipdiff @@ -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