summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@novell.com>2010-06-29 22:50:38 +0200
committerThorsten Behrens <tbehrens@novell.com>2010-06-29 22:50:38 +0200
commit5114d906b7342cbc9c5681ec13d60e7f32b82307 (patch)
tree5daf3a5a887a20664d923418447fe01cf531ae4e
parent227697953e3171b80035bee2e5644d53d26360e0 (diff)
make ooxmldiff work with files w/ same name, diff. paths
-rwxr-xr-xooxmldiff17
1 files changed, 12 insertions, 5 deletions
diff --git a/ooxmldiff b/ooxmldiff
index 1df2bdc..4488a3d 100755
--- a/ooxmldiff
+++ b/ooxmldiff
@@ -2,7 +2,7 @@
function usage()
{
- echo "$0 <file1> <file2>"
+ echo "$0 <file1> <file2> [xmlfile]"
}
function extract()
@@ -23,7 +23,7 @@ function extract()
done
}
-if [ $# != 2 ]
+if [ $# != 2 -a $# != 3 ]
then
usage
exit 1
@@ -35,13 +35,20 @@ FILE2=$2
TMP=/tmp/ooxmldiff
# Extract both files
-TMP1=$TMP/`basename $FILE1`
+TMP1=$TMP/`basename $FILE1`1
extract $FILE1 $TMP1
-TMP2=$TMP/`basename $FILE2`
+TMP2=$TMP/`basename $FILE2`2
extract $FILE2 $TMP2
-diff -ru $TMP1 $TMP2
+if [ $# == 3 ]
+then
+ TMP1=$TMP1$3
+ TMP2=$TMP2$3
+ diff -u $TMP1 $TMP2
+else
+ diff -ru $TMP1 $TMP2
+fi
# Clean up the whole place
rm -r $TMP