#!/bin/bash # # zipdiff.sh - extract two zip files and create unified diff # Copyright (C) 2011 Claire Xenia Wolf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # if [ $# -ne 2 ]; then echo "Usage: $0 old-zip new-zip" >&2 exit 1 fi tmp1="$(mktemp -d)" tmp2="$(mktemp -d)" trap 'rm -rf "$tmp1" "$tmp2"' 0 set -e unzip "$1" -d "$tmp1" unzip "$2" -d "$tmp2" diff -ruN "$tmp1" "$tmp2" | filterdiff --strip=3