7 $0 -o difference.zip -f from.zip -t to.zip
8 $0 -f from.zip -t to.zip
25 find "$@" -xtype f \( -executable -or -type l \) -print > "$ziplist"
26 7za a -tzip $sevenzipflags -x@"$ziplist" "$archive" "$@" || true
27 zip $zipflags -y -@<"$ziplist" "$archive" || true
31 while [ $# -gt 0 ]; do
48 excludes="$excludes $1"
61 [ -n "$from" ] || usage
68 echo >&2 "$type: $source"
76 echo >&2 " * Sorry, can't handle deletion of $source."
81 tempdir=`mktemp -d -t zipdiff.XXXXXX`
85 fromlist="$(zipinfo -1 "$from" | grep -v /\$)"
86 tolist="$(zipinfo -1 "$to" | grep -v /\$)"
90 echo "$fromlist" | while IFS= read -r line; do
91 case "$newline$tolist$newline" in
92 *$newline$line$newline*)
97 for P in $excludes; do
100 found excluded "$line"
107 if ! $isexcluded; then
108 found deleted "$line"
113 echo "$tolist" | while IFS= read -r line; do
114 case "$newline$fromlist$newline" in
115 *$newline$line$newline*)
119 for P in $excludes; do
122 found excluded "$line"
129 if ! $isexcluded; then
130 unzip -p "$from" "$line" > "$tempdir/v1"
131 unzip -p "$to" "$line" > "$tempdir/v2"
132 if ! diff --brief "$tempdir/v1" "$tempdir/v2" >/dev/null 2>&1; then
133 found changed "$line"
143 for P in $excludes; do
146 found excluded "$line"
153 if ! $isexcluded; then
168 if [ -n "$result" ]; then
169 echo "$result" | while IFS= read -r line; do
170 echo >&2 "extracting $line..."
172 mkdir -p "$tempdir/${dline%/*}"
173 unzip -p "$to" "$line" > "$tempdir/$line" # this may create an empty file - don't care, DP handles this as deletion