update changelog
[debian/sudo] / sudoers.man.pl
index 9ee210a44257cc6b9fec96a960fb087d5c410af1..6e5da2c2896787d25fc676e5f68cfeef6c037fa0 100644 (file)
@@ -1,25 +1,39 @@
 #!/usr/bin/perl -p
 
 BEGIN {
-    $t = undef;
+    $cond = -1;
 }
 
-if (/^\./) {
-    if (/^\.I[PX].*use_loginclass/) {
-       $t = '@LCMAN@';
-    } elsif (/^\.I[PX].*(role|type)/) {
-       $t = '@SEMAN@';
-    } else {
-       $t = undef;
-    }
+# Initialize the numeric register we use for conditionals
+if ($cond == -1) {
+    $_ = ".nr SL \@SEMAN\@\n.nr BA \@BAMAN\@\n.nr LC \@LCMAN\@\n.\\\"\n$_";
+    $cond = 0;
+}
+
+# Make SELinux_Spec conditional
+if (/(.*)SELinux_Spec\? (.*)$/) {
+    $_ = ".ie \\n(SL $_.el $1$2\n";
+} elsif (/^(.*SELinux_Spec ::=)/) {
+    $_ = ".if \\n(SL \\{\\\n$_";
+} elsif (/^(.*Tag_Spec ::=)/) {
+    $_ = "\\}\n$_";
+}
+
+if (/^\.S[Sh] "SELinux_Spec"/) {
+    $_ = ".if \\n(SL \\{\\\n$_";
+    $cond = 1;
+} elsif (/^\.IP "(role|type)"/) {
+    $_ = ".if \\n(SL \\{\\\n$_";
+    $cond = 1;
+} elsif (/^\.IP "use_loginclass"/) {
+    $_ = ".if \\n(LC \\{\\\n$_";
+    $cond = 1;
+} elsif ($cond && /^\.(Sh|SS|IP|PP)/) {
+    $_ = "\\}\n$_";
+    $cond = 0;
 }
 
 # Fix up broken pod2man formatting of F<@foo@/bar>
 s/\\fI\\f(\(C)?I\@([^\@]*)\\fI\@/\\fI\@$2\@/g;
 s/\\f\(\CW\@([^\@]*)\\fR\@/\@$1\@/g;
 #\f(CW@secure_path\fR@
-
-# Comment out Compile-time-specific lines in DESCRIPTION
-if ($t) {
-    $_ = $t . $_;
-}