aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2018-12-12 18:53:07 -0500
committerMichael S. Tsirkin <mst@redhat.com>2019-01-11 16:05:49 -0500
commit36da9bfcfb12eb0754f633aab0b178a976a2c06c (patch)
treee5cd6308a147462d8b4197b012b6cf0ae71e561b
parentc3c0bccf18450733c465ed51b7add2d749cbc78d (diff)
downloadvirtio-text-36da9bfcfb12eb0754f633aab0b178a976a2c06c.tar.gz
edit: more fixup diff hacks
Tweak latex diff output some more to fix up failures. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--fixupdiff.pl15
1 files changed, 13 insertions, 2 deletions
diff --git a/fixupdiff.pl b/fixupdiff.pl
index f66eaa3..ce67a42 100644
--- a/fixupdiff.pl
+++ b/fixupdiff.pl
@@ -26,8 +26,19 @@ while (<>) {
# As a result, number of \color directives goes does sufficiently
# enough to avoid the overflow error.
- $line =~ s/\\DIFdelbegin \\DIFdel\{([^}]*)\}\\DIFdelend/\\DIFdeltext{$1}/;
- $line =~ s/\\DIFaddbegin \\DIFadd\{([^}]*)\}\\DIFaddend/\\DIFaddtext{$1}/;
+ if ($line =~ m/\\drivernormative|\\devicenormative/) {
+ #3rd argument in normative statements is a label. Don't put it in diffs.
+ $line =~ s/(normative\{[^{]*\{[^{]*\{[^{\\]*)\\DIFdelbegin \\DIFdel\{([^}]*)\}\\DIFdelend/$1$2/;
+ $line =~ s/(normative\{[^{]*\{[^{]*\{[^{\\]*)\\DIFaddbegin \\DIFadd\{([^}]*)\}\\DIFaddend/$1$2/;
+ $line =~ s/(normative\{[^{]*\{[^{]*\{[^{\\]*)\\DIFdel\{([^}]*)\}/$1$2/;
+ $line =~ s/(normative\{[^{]*\{[^{]*\{[^{\\]*)\\DIFadd\{([^}]*)\}/$1$2/;
+ } elsif ($line =~ m/section|paragraph/) {
+ $line =~ s/\\DIFdelbegin \\DIFdel\{([^}]*)\}\\DIFdelend/\\DIFdel{$1}/;
+ $line =~ s/\\DIFaddbegin \\DIFadd\{([^}]*)\}\\DIFaddend/\\DIFadd{$1}/;
+ } else {
+ $line =~ s/\\DIFdelbegin \\DIFdel\{([^}]*)\}\\DIFdelend/\\DIFdeltext{$1}/;
+ $line =~ s/\\DIFaddbegin \\DIFadd\{([^}]*)\}\\DIFaddend/\\DIFaddtext{$1}/;
+ }
print $line;
if (m/%DIFDELCMD\s+<\s+\\end\{lstlisting\}/) {