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
64 case "$output" in '') ;; /*) ;; *) output=`pwd`/$output ;; esac
65 case "$from" in /*) ;; *) from=`pwd`/$from ;; esac
66 case "$to" in /*) ;; *) to=`pwd`/$to ;; esac
72 echo >&2 "$type: $source"
80 echo >&2 " * Sorry, can't handle deletion of $source."
85 tempdir=`mktemp -d -t zipdiff.XXXXXX`
89 fromlist="$(zipinfo -1 "$from" | grep -v /\$)"
90 tolist="$(zipinfo -1 "$to" | grep -v /\$)"
94 echo "$fromlist" | while IFS= read -r line; do
95 case "$newline$tolist$newline" in
96 *$newline$line$newline*)
101 for P in $excludes; do
104 found excluded "$line"
111 if ! $isexcluded; then
112 found deleted "$line"
117 echo "$tolist" | while IFS= read -r line; do
118 case "$newline$fromlist$newline" in
119 *$newline$line$newline*)
123 for P in $excludes; do
126 found excluded "$line"
133 if ! $isexcluded; then
134 unzip -p "$from" "$line" > "$tempdir/v1"
135 unzip -p "$to" "$line" > "$tempdir/v2"
136 if ! diff --brief "$tempdir/v1" "$tempdir/v2" >/dev/null 2>&1; then
137 found changed "$line"
147 for P in $excludes; do
150 found excluded "$line"
157 if ! $isexcluded; then
172 if [ -n "$result" ]; then
174 echo "$result" | while IFS= read -r line; do
175 echo >&2 "extracting $line..."
177 mkdir -p "$tempdir/${dline%/*}"