summaryrefslogtreecommitdiff
path: root/fixupdiff.pl
diff options
context:
space:
mode:
authormstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2015-03-15 11:10:49 +0000
committermstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2015-03-15 11:10:49 +0000
commitf612f689e7e97df615294f090b14d06a31fdabab (patch)
tree6eb19c11603f3f3c92367ab2f55f8060b75da7e5 /fixupdiff.pl
parentc9873341c915886263023cd7e30320c5c9736c6f (diff)
makediff: work around for lstlisting
latexdiff seems to go wild trying to diff lstlisting. But marking lstlisting as picture - so old text is commented out - then removing the comment sign - seems to work, with the only disadvantage being that listing is diffed as a whole. Seems to be the best I can come up with ATM. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio/branches/v1.0@484 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
Diffstat (limited to 'fixupdiff.pl')
-rw-r--r--fixupdiff.pl14
1 files changed, 14 insertions, 0 deletions
diff --git a/fixupdiff.pl b/fixupdiff.pl
new file mode 100644
index 0000000..70d4e30
--- /dev/null
+++ b/fixupdiff.pl
@@ -0,0 +1,14 @@
+my $lstlisting=0;
+while (<>) {
+ my $line = $_;
+ if (m/%DIFDELCMD\s+<\s+\\begin{lstlisting}/) {
+ $lstlisting=1;
+ }
+ if ($lstlisting) {
+ $line =~ s/%DIFDELCMD\s+<\s+//;
+ }
+ print $line;
+ if (m/%DIFDELCMD\s+<\s+\\end{lstlisting}/) {
+ $lstlisting=0;
+ }
+}