aboutsummaryrefslogtreecommitdiff
path: root/scripts/pd-diff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2005-04-18 00:36:10 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2005-04-18 00:36:10 +0000
commit9727e8625658520e5fdbfb0b9e9903ad540da648 (patch)
tree4a55afe5865cb790efaa7c89418a2eb209f78113 /scripts/pd-diff
parentecf4375873c98f4864b3d1469be19a28770656fe (diff)
This commit was generated by cvs2svn to compensate for changes in r2777,
which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=2778
Diffstat (limited to 'scripts/pd-diff')
-rwxr-xr-xscripts/pd-diff48
1 files changed, 48 insertions, 0 deletions
diff --git a/scripts/pd-diff b/scripts/pd-diff
new file mode 100755
index 00000000..4c8837e0
--- /dev/null
+++ b/scripts/pd-diff
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+DATE=`date '+%Y-%m-%d_%H.%M.%S'`
+TMPDIR=/tmp/pd-diff
+
+#------------------------------------------------------------------------------
+# FUNCTIONS
+generate_tmp_filename () {
+ echo $TMPDIR/`echo $1 | sed -e 's|/|_|g'`-$DATE
+}
+
+prep_for_diff () {
+ TMPFILE=`generate_tmp_filename "$1"`
+ cat "$1" | \
+ tail +2 | \
+ grep -v '#X connect ' | \
+ sed 's/\(#[XN] [a-z]+\) [0-9]+ [0-9]+/\1/' \
+ > $TMPFILE
+}
+
+#------------------------------------------------------------------------------
+# THE PROGRAM
+
+if [ $# -ne 2 ]; then
+ echo "ERROR: Invalid number of arguments ($#)"
+ echo "Usage: $0 FILE FILE"
+else
+ if [ ! -d $TMPDIR ]; then
+ mkdir $TMPDIR
+ fi
+
+
+ TMP1=`generate_tmp_filename "$1"`
+ TMP2=`generate_tmp_filename "$2"`
+
+ prep_for_diff "$1"
+ prep_for_diff "$2"
+
+# diff of everything except "#X connect"'s
+ diff -uw "$TMP1" "$TMP2"
+
+ file1count=`grep -v '#X connect ' "$1" | wc -l`
+ file2count=`grep -v '#X connect ' "$2" | wc -l`
+ if [ $file1count -ne $file2count ]; then
+ echo "---------------------------------------------------------"
+ echo Connections differ: $file1count vs. $file2count
+ fi
+fi