diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2018-12-13 15:06:47 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2019-01-11 16:05:49 -0500 |
commit | c8cf8156b64c31c1074f47c8a0ee804f00d05888 (patch) | |
tree | f9572cb61ab62e37e53689548968744c925dc093 | |
parent | 36da9bfcfb12eb0754f633aab0b178a976a2c06c (diff) | |
download | virtio-spec-c8cf8156b64c31c1074f47c8a0ee804f00d05888.tar.gz |
edit: teach diff to re-add back missing labels
For now just rely on a manual list.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | fixupdiff.pl | 30 |
1 files changed, 30 insertions, 0 deletions
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: |