From c8cf8156b64c31c1074f47c8a0ee804f00d05888 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Thu, 13 Dec 2018 15:06:47 -0500 Subject: edit: teach diff to re-add back missing labels For now just rely on a manual list. Signed-off-by: Michael S. Tsirkin --- fixupdiff.pl | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'fixupdiff.pl') diff --git a/fixupdiff.pl b/fixupdiff.pl index ce67a42..1a49873 100644 --- a/fixupdiff.pl +++ b/fixupdiff.pl @@ -1,5 +1,19 @@ use strict; +my @protected_labels = ( +'devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Interrupt Suppression', +'devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Notification Suppression', +'devicenormative:General Initialization And Device Operation / Device Operation / Supplying Buffers to The Device / Virtqueue Notification Suppression', +'devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Virtqueue Interrupts From The Device', +'drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Interrupt Suppression', +'drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Notification Suppression', +'drivernormative:General Initialization And Device Operation / Device Operation / Supplying Buffers to The Device / Notifying The Device', +'drivernormative:General Initialization And Device Operation / Device Operation / Supplying Buffers to The Device / Updating idx', +'sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Interrupt Suppression', +'sec:General Initialization And Device Operation / Device Operation / Receiving Used Buffers From The Device', +'sec:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Notifying The Device', +'sec:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Virtqueue Interrupts From The Device', +); my $lstlisting=0; while (<>) { @@ -16,6 +30,22 @@ while (<>) { } #print "%FIXED BY RULE 1\n"; } + if ($line =~ m/%DIFDELCMD\s+<\s+\\label\{([^}]*)\}/) { + my $label = $1; + foreach my $l (@protected_labels) { + if ($l eq $label) { + $line =~ s/(%DIFDELCMD\s+<\s+)\\label\{([^}]*)\}/\\label\{$label\}$1/; + } + } + } + if ($line =~ m/%DIFDELCMD\s+<\s+\\((driver|device)normative)\{[^{]*\{[^{]*\{([^}\\]*)\}/) { + my $label = "$1:$3"; + foreach my $l (@protected_labels) { + if ($l eq $label) { + $line =~ s/(%DIFDELCMD\s+<\s+)\\((driver|device)normative)\{[^{]*\{[^{]*\{([^}\\]*)\}/\\label\{$label\}$1/; + } + } + } # Too many \color directives (generated by DIFdel/addbegin/end) # confuse xetex, producing errors: -- cgit