From fedora-docs-commits at redhat.com Wed Jun 10 15:29:19 2015 Content-Type: multipart/mixed; boundary="===============8872153584189868406==" MIME-Version: 1.0 From: fedora-docs-commits at redhat.com To: docs-commits at lists.fedoraproject.org Subject: docs-common/bin xmldiff, NONE, 1.1 xmldiff.pl, NONE, 1.1 xmlpp, NONE, 1.1 Date: Wed, 14 Dec 2005 22:20:04 -0500 Message-ID: <200512150320.jBF3K4v3000653@cvs-int.fedora.redhat.com> --===============8872153584189868406== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: jtr Update of /cvs/docs/docs-common/bin In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv565 Added Files: xmldiff xmldiff.pl xmlpp = Log Message: Here is a very simple XMLDIFF tool that I've hacked to work reasonably with the FDP files. Look in the "xmldiff.pl" file for information about its origin. --- NEW FILE xmldiff --- #!/bin/sh export PATH=3D`dirname $0`:${PATH} exec perl `basename $0`.pl $@ --- NEW FILE xmldiff.pl --- #!/usr/bin/perl # # Copyright (c) 2002, DecisionSoft Limited All rights reserved. # Please see: = # http://software.decisionsoft.com/licence.html = # for more information. # # Modified for the Fedora Docs Project by Tommy.Reynolds(a)MegaCoder.com # = # # xmldiff: xmldiff program - uses xmlpp, which must be on the ${PATH} # #Change this if xmlpp is not in your current path #for example: $XMLPP =3D "./xmlpp"; $XMLPP =3D "xmlpp"; use Getopt::Std; getopts('tscupChHSi'); if ($opt_h || @ARGV !=3D 2) { usage(); } my $diffOpts; my $outputFmt =3D $opt_u + $opt_c + $opt_s + $opt_p + $opt_C; if( $outputFmt =3D=3D 0 ) { $outputFmt =3D $opt_p =3D 1; } if( $outputFmt > 1 ) { print STDERR "Error: Only one mode may be specified\n"; usage(); } if( $opt_s ) { # Standard diff, no playing around } = if ( $opt_c ) { # Plain context diff $diffOpts .=3D "-c "; } = if( $opt_u ) { # Plain unified diff $diffOpts .=3D "-u "; } = if( $opt_p ) { # Colorized unified diff # $diffOpts .=3D "-u "; $diffOpts .=3D "--new-line-format=3D'=1B[1m=1B[33m+ %l\n=1B[m' "; $diffOpts .=3D "--old-line-format=3D'=1B[1m=1B[31m- %l\n=1B[m' "; $diffOpts .=3D "--unchanged-line-format=3D'=1B[1m=1B[30m %l=1B[m\n' "; } = if( $opt_C ) { $diffOpts .=3D "--changed-group-format=3D'\n<<<<<<<<<<<<<<\n%<=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n%>>>>>>>>>>>>>>>\n\n' "; $diffOpts .=3D "--new-line-format=3D'+ %l\n' "; $diffOpts .=3D "--old-line-format=3D'- %l\n' "; $diffOpts .=3D "--unchanged-line-format=3D' %l\n' "; } = if( $opt_H ) { $diffOpts .=3D "--changed-group-format=3D'%<%>' "; $diffOpts .=3D " --new-group-format=3D'%>' "; $diffOpts .=3D "--old-group-format=3D'%<' "; $diffOpts .=3D "--new-line-format=3D'+ %l\= n' "; $diffOpts .=3D "--old-line-format=3D'- %l\n'= "; $diffOpts .=3D "--unchanged-line-format=3D' %l\n' "; } # Set up xmlpp options my $prettyOpts =3D $opt_t ? "-t " : ""; $prettyOpts .=3D $opt_S ? "-S " : ""; $prettyOpts .=3D $opt_H ? "-H " : ""; $prettyOpts .=3D "-s -e "; $file1 =3D "xmlppTEMP1.$$"; $file2 =3D "xmlppTEMP2.$$"; my $results =3D 0; $results +=3D system("$XMLPP $prettyOpts '$ARGV[0]' > $file1"); $results +=3D system("$XMLPP $prettyOpts '$ARGV[1]' > $file2"); if($opt_H) { print "\n"; print " \n"; print " XML Diff\n"; print " \n"; print " \n"; print "
";
	$results +=3D system("/usr/bin/diff -bB $diffOpts $file1 $file2");
	# Do not add extra whitespace before the 
print "\n"; print " \n"; print "\n"; } else { $results +=3D system("/usr/bin/diff -bB $diffOpts $file1 $file2"); } unlink($file1,$file2); exit( $results ); sub usage { print STDERR <