Author: jtr
Update of /cvs/docs/docs-common/bin In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7940
Modified Files: xmldiff.pl Removed Files: xmlpp Log Message: Switched to our own XMLFORMAT tool to prepare the files for comparison. As long as the original files have been normalized by XMLFORMAT, then the line numbers output by XMLDIFF will be correct. Why would you *not* work with normalized files?
Index: xmldiff.pl =================================================================== RCS file: /cvs/docs/docs-common/bin/xmldiff.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- xmldiff.pl 15 Dec 2005 05:42:45 -0000 1.2 +++ xmldiff.pl 15 Dec 2005 06:15:49 -0000 1.3 @@ -13,12 +13,12 @@ #
#Change this if xmlpp is not in your current path -#for example: $XMLPP = "./xmlpp"; -$XMLPP = "xmlpp"; +#for example: $XMLFORMAT = "./xmlpp"; +# $XMLFORMAT = "xmlpp";
use Getopt::Std;
-getopts('tscupChHSi'); +getopts('scupChi');
if ($opt_h || @ARGV != 2) { usage(); @@ -54,45 +54,18 @@ $diffOpts .= "--new-line-format='+ %l\n' "; $diffOpts .= "--old-line-format='- %l\n' "; $diffOpts .= "--unchanged-line-format=' %l\n' "; -} elsif( $opt_H ) { - $diffOpts .= "--changed-group-format='%<%>' "; - $diffOpts .= " --new-group-format='%>' "; - $diffOpts .= "--old-group-format='%<' "; - $diffOpts .= "--new-line-format='<font color="green">+ %l</font>\n' "; - $diffOpts .= "--old-line-format='<font color="red">- %l</font>\n' "; - $diffOpts .= "--unchanged-line-format='<font color="gray"> %l</font>\n' "; }
-# Set up xmlpp options - -my $prettyOpts = $opt_t ? "-t " : ""; -$prettyOpts .= $opt_S ? "-S " : ""; -$prettyOpts .= $opt_H ? "-H " : ""; -$prettyOpts .= "-s -e "; +$XMLFORMAT = "xmlformat";
$file1 = "xmlppTEMP1.$$"; $file2 = "xmlppTEMP2.$$";
my $results = 0; -$results += system("$XMLPP $prettyOpts '$ARGV[0]' > $file1"); -$results += system("$XMLPP $prettyOpts '$ARGV[1]' > $file2"); - -if($opt_H) { - print "<HTML>\n"; - print " <HEAD>\n"; - print " <TITLE>XML Diff</TITLE>\n"; - print " </HEAD>\n"; - print " <BODY bgcolor="#FEFEFF">\n"; - print " <PRE>"; - $results += system("/usr/bin/diff -bB $diffOpts $file1 $file2"); - # Do not add extra whitespace before the </PRE> - print "</PRE>\n"; - print " </BODY>\n"; - print "</HTML>\n"; +$results += system("$XMLFORMAT '$ARGV[0]' > $file1"); +$results += system("$XMLFORMAT '$ARGV[1]' > $file2");
-} else { - $results += system("/usr/bin/diff -bB $diffOpts $file1 $file2"); -} +$results += system("/usr/bin/diff -bB $diffOpts $file1 $file2");
unlink($file1,$file2); @@ -111,9 +84,7 @@ -C vaguely CVS like unified diff
options: - -H HTML output -t split attributes - good for spotting changes in attributes - -S schema hack mode - good for diffing schemas -i ignore element and attribute contents
EOF
--- xmlpp DELETED ---
docs-commits@lists.fedoraproject.org