summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rwxr-xr-xunix/installManPage36
2 files changed, 24 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 912cc06..d4bff04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-01 Reinhard Max <max@suse.de>
+
+ * unix/installManPage: Fix the script for manpages that have
+ quotes around the .SH arguments, as doctools produces them
+ (Bug#1292145). Some minor cleanups and improvements.
+
2006-02-28 Don Porter <dgp@users.sourceforge.net>
* generic/tclBasic.c: Corrections to be sure that TCL_EVAL_GLOBAL
diff --git a/unix/installManPage b/unix/installManPage
index 93fd925..3bc3bd7 100755
--- a/unix/installManPage
+++ b/unix/installManPage
@@ -22,34 +22,34 @@ test -z "$S" && S="$DIR/"
# A sed script to parse the alternative names out of a man page.
#
-# /^\\.SH NAME/{ ;# Look for a line, that starts with .SH NAME
-# s/^.*$// ;# Delete the content of this line from the buffer
-# n ;# Read next line
-# s/,//g ;# Remove all commas ...
-# s/\\\ //g ;# .. and backslash-escaped spaces.
-# s/ \\\-.*// ;# Delete from \- to the end of line
-# p ;# print the result
-# q ;# exit
-# }
-#
# Backslashes are trippled in the sed script, because it is in
-# backticks which don't pass backslashes literally.
+# backticks which doesn't pass backslashes literally.
#
-# Please keep the commented version above updated if you
-# change anything to the script below.
NAMES=`sed -n '
- /^\\.SH NAME/{
- s/^.*$//
+ # Look for a line, that starts with .SH NAME
+ # optionally allow NAME to be surrounded
+ # by quotes.
+ /^\.SH "\?NAME"\?/{
+ # Read next line
n
+ # Remove all commas ...
s/,//g
+ # ... and backslash-escaped spaces.
s/\\\ //g
+ # Delete from \- to the end of line
s/ \\\-.*//
- p
- q
+ # print the result and exit
+ p;q
}' $MANPAGE`
-SECTION=`echo $MANPAGE | sed 's/.*\(.\)$/\1/'`
+case $MANPAGE in
+ *.1) SECTION=1 ;;
+ *.3) SECTION=3 ;;
+ *.n) SECTION=n ;;
+esac
+
SRCDIR=`dirname $MANPAGE`
+
FIRST=""
for f in $NAMES; do
f=$f.$SECTION$SUFFIX