diff options
author | Muthu Subramanian <sumuthu@novell.com> | 2010-06-29 22:50:38 +0200 |
---|---|---|
committer | Thorsten Behrens <tbehrens@novell.com> | 2010-06-29 22:50:38 +0200 |
commit | 5114d906b7342cbc9c5681ec13d60e7f32b82307 (patch) | |
tree | 5daf3a5a887a20664d923418447fe01cf531ae4e | |
parent | 227697953e3171b80035bee2e5644d53d26360e0 (diff) |
make ooxmldiff work with files w/ same name, diff. paths
-rwxr-xr-x | ooxmldiff | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -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 |