From cf272674765288f8c20146787b8b0d666fb8f52d Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Fri, 20 Nov 2009 15:18:51 -0700 Subject: [PATCH] add sudo.man.pl and sudoers.man.pl from upstream, which were apparently accidentally left out of the 1.7.2p1 tarball, and restore the Makefile.in content which calls them, closes: #557204 --- Makefile.in | 4 ++-- debian/changelog | 6 ++++++ sudo.man.pl | 23 +++++++++++++++++++++++ sudoers.man.pl | 25 +++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 sudo.man.pl create mode 100644 sudoers.man.pl diff --git a/Makefile.in b/Makefile.in index a26f6cd..207004d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -365,7 +365,7 @@ sia.o: $(authdir)/sia.c $(AUTHDEP) sudo.man.in: $(srcdir)/sudo.pod @rm -f $(srcdir)/$@ - ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudo.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudo.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" >> $@ ) + ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudo.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudo.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" | perl -p sudo.man.pl >> $@ ) sudo.man: sudo.man.in CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status @@ -383,7 +383,7 @@ visudo.cat: visudo.man sudoers.man.in: $(srcdir)/sudoers.pod @rm -f $(srcdir)/$@ - ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudoers.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectform --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoers.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" >> $@ ) + ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudoers.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectform --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoers.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" | perl -p sudoers.man.pl >> $@ ) sudoers.man:: sudoers.man.in CONFIG_FILES=$@ CONFIG_HEADERS= sh ./config.status diff --git a/debian/changelog b/debian/changelog index 559b8dc..e1281ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sudo (1.7.2p1-2) UNRELEASED; urgency=low + + * working on substitution variables in man pages + + -- Bdale Garbee Fri, 20 Nov 2009 07:31:30 -0700 + sudo (1.7.2p1-1) unstable; urgency=low * new upstream version diff --git a/sudo.man.pl b/sudo.man.pl new file mode 100644 index 0000000..4d23fbd --- /dev/null +++ b/sudo.man.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl -p + +BEGIN { + %tags = ( 'a', '@BAMAN@', 'c', '@LCMAN@', 'r', '@SEMAN@', 't', '@SEMAN@'); + $t = undef; +} +if (/^\.IP(.*-([acrt]))?/) { + $t = $1 ? $tags{$2} : undef; +} elsif (/-a.*auth_type/) { + $_ = $tags{'a'} . $_; +} elsif (/(-c.*class.*\||login_cap)/) { + $_ = $tags{'c'} . $_; +} elsif (/-r.*role.*-t.*type/) { + $_ = $tags{'r'} . $_; +} + +# Fix up broken pod2man formatting of F<@foo@/bar> +s/\\fI\\f(\(C)?I\@([^\@]*)\\fI\@/\\fI\@$2\@/g; + +# comment out Compile-time-specific lines in DESCRIPTION +if ($t) { + $_ = $t . $_; +} diff --git a/sudoers.man.pl b/sudoers.man.pl new file mode 100644 index 0000000..9ee210a --- /dev/null +++ b/sudoers.man.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl -p + +BEGIN { + $t = undef; +} + +if (/^\./) { + if (/^\.I[PX].*use_loginclass/) { + $t = '@LCMAN@'; + } elsif (/^\.I[PX].*(role|type)/) { + $t = '@SEMAN@'; + } else { + $t = undef; + } +} + +# 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 . $_; +} -- 2.30.2