[Reproducible-commits] [txt2man] 08/13: Imported Upstream version 1.5.6
Reiner Herrmann
reiner at reiner-h.de
Thu Jul 2 16:52:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
deki-guest pushed a commit to branch pu/reproducible_builds
in repository txt2man.
commit ac21ca4bcd6248b29972d6b6cb4f760e8e4692dc
Author: Joao Eriberto Mota Filho <eriberto at debian.org>
Date: Sat Jan 31 18:10:24 2015 -0200
Imported Upstream version 1.5.6
---
Changelog | 10 ++++++++++
Makefile | 2 +-
bookman | 42 +++++++++++++++++++++---------------------
bookman.1 | 4 ++--
src2man | 26 +++++++++++++++-----------
src2man.1 | 14 ++++----------
txt2man | 39 +++++++++++++++++++++------------------
txt2man.1 | 4 ++--
8 files changed, 76 insertions(+), 65 deletions(-)
diff --git a/Changelog b/Changelog
index 9741893..b89e847 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,13 @@
+txt2man-1.5.6 16-mar-2011
+
+* txt2man: Better control of 3 letters regexp, by Robin Cornelius.
+* txt2man: Fix header comment generation, by Robin Cornelius.
+* txt2man: Better handle ticks, by Thomas Moschny.
+* src2man: Fix header comment generation.
+* src2man: more robust comment delimiter handling.
+* src2man: support C prototypes with newline after type, by Diego Cena.
+* bookman: Posix shell syntax.
+
txt2man-1.5.5 21-mar-2007
* txt2man: correct layout of C structures in synopsis
diff --git a/Makefile b/Makefile
index ecb4ef5..ede13cc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# Makefile
prefix ?= /usr/local
-version = txt2man-1.5.5
+version = txt2man-1.5.6
BIN = src2man bookman txt2man
MAN1 = src2man.1 txt2man.1 bookman.1
diff --git a/bookman b/bookman
index 11bd913..ad7bc1e 100755
--- a/bookman
+++ b/bookman
@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-# release 1.5.5
+# release 1.5.6
man() {
cat << \EOT
@@ -65,19 +65,19 @@ post="grops"
while getopts :a:c:d:mno:pPr:t:v:x opt
do
case $opt in
- a) author="$OPTARG";;
- c) cover="$OPTARG";;
- d) date="$OPTARG";;
- m) man; exit;;
- n) post="cat";;
- o) outfile="$OPTARG";;
- p) post="grops | ps2pdf -";;
- P) post=grops;;
- x) post="gxditview -";;
- r) release="$OPTARG";;
- t) title="$OPTARG";;
- v) volume="$OPTARG";;
- *) man; exit;;
+ (a) author=$OPTARG;;
+ (c) cover=$OPTARG;;
+ (d) date=$OPTARG;;
+ (m) man; exit;;
+ (n) post=cat;;
+ (o) outfile=$OPTARG;;
+ (p) post='grops | ps2pdf -';;
+ (P) post=grops;;
+ (x) post='gxditview -';;
+ (r) release=$OPTARG;;
+ (t) title=$OPTARG;;
+ (v) volume=$OPTARG;;
+ (*) man; exit;;
esac
done
shift $(($OPTIND - 1))
@@ -92,7 +92,7 @@ date=${date:-$(date +'%d %B %Y')}
# Generate output in gtroff intermediate format, so
# it can be merged with content.
{
- [[ -f $cover ]] && cat $cover || {
+ [ -f "$cover" ] && cat "$cover" || {
printf ".af %% i\n.P1\n"
printf ".OH ||%s||\n" "$volume"
printf ".EH ||%s||\n" "$volume"
@@ -104,9 +104,9 @@ date=${date:-$(date +'%d %B %Y')}
for f
do
case $f in
- *.Z|*.gz) zcat$f;;
- *.bz2) bzcat $f;;
- *) cat $f;;
+ (*.Z|*.gz) zcat$f;;
+ (*.bz2) bzcat $f;;
+ (*) cat $f;;
esac
done | groff -man -rC1 -Tps | awk '
$1 == "%%Page:" {page = $2}
@@ -133,9 +133,9 @@ date=${date:-$(date +'%d %B %Y')}
for f
do
case $f in
- *.Z|*.gz) zcat $f;;
- *.bz2) bzcat $f;;
- *) cat $f;;
+ (*.Z|*.gz) zcat $f;;
+ (*.bz2) bzcat $f;;
+ (*) cat $f;;
esac
done | groff -Z -man -rC1 | awk 'NR >3'
diff --git a/bookman.1 b/bookman.1
index 296bb7a..e0b6c46 100644
--- a/bookman.1
+++ b/bookman.1
@@ -1,5 +1,5 @@
-." Text automatically generated by txt2man
-.TH bookman 1 "21 March 2007" "txt2man-1.5.5" ""
+.\" Text automatically generated by txt2man
+.TH bookman 1 "16 March 2011" "txt2man-1.5.6" ""
.SH NAME
\fBbookman \fP- Generate a book from man pages
.SH SYNOPSIS
diff --git a/src2man b/src2man
index d10eb29..33c1d2c 100755
--- a/src2man
+++ b/src2man
@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-# release 1.5.5
+# release 1.5.6
man() {
cat << \EOT
@@ -33,7 +33,7 @@ DESCRIPTION
The first line of the comment block must contain the name of the
manpage, usually the function name, followed by a "-" and a short
- description. The following lines are the "DESCRIPTION" section
+ description. The following lines are the "DESCRIPTION" section
content, except if they are in upper case, in which case they define
a new section.
@@ -41,7 +41,7 @@ DESCRIPTION
section will be generated. Otherwise, src2man will look in the following
source lines for a function prototype or a type definion (struct,
union, typedef, ...) matching the manpage name, and include it in a
- "SYNOPSIS" section. This avoids to duplicate the type or function
+ "SYNOPSIS" section. This avoids to duplicate the type or function
prototype in the comment block.
The best place for code documentation is in the source file, where
@@ -86,11 +86,11 @@ release=unknown
while getopts :d:hnr:v: opt
do
case $opt in
- d) date="$OPTARG";;
- n) nogen=1;;
- v) volume="$OPTARG";;
- r) release="$OPTARG";;
- *) man; exit;;
+ (d) date="$OPTARG";;
+ (n) nogen=1;;
+ (v) volume="$OPTARG";;
+ (r) release="$OPTARG";;
+ (*) man; exit;;
esac
done
shift $(($OPTIND - 1))
@@ -101,10 +101,10 @@ date=${date:-$(date +'%d %B %Y')}
# commment blocks starting by "/** sectnum"
#
awk -v release="$release" -v volume="$volume" -v nogen=$nogen '
-/\/\*\* [0-9]/ {
+$1 == "/**" && $2 ~ /^[0-9]/ {
sect = $2
getline
- sub(/^ \* */, " ")
+ sub(/^ *\* */, " ")
title = $1
line1_after_comment = 0
in_struct = 0
@@ -159,6 +159,10 @@ awk -v release="$release" -v volume="$volume" -v nogen=$nogen '
if ($0 ~ " *" tname[1] "[; ][*]*") break
continue
}
+ if ($0 !~ /\)$/) {
+ getline
+ synop = synop " " $0
+ }
if ($0 ~/\)[ \t{}\;]*$/) {
sub(/{[^}]}/, "", synop)
sub(/[ \t]*$/, "", synop)
@@ -177,7 +181,7 @@ awk -v release="$release" -v volume="$volume" -v nogen=$nogen '
}
print "NAME\n" name (synop ? "\nSYNOPSIS\n " synop : "") \
"\nDESCRIPTION\n" desc "\nFILE\n " FILENAME | \
- "{ echo .\\\" Extracted by src2man from " FILENAME "; \
+ "{ echo '\''.\\\" Extracted by src2man from " FILENAME "'\''; \
txt2man -d \"$date\" -v \"" volume "\" -r " release \
" -s " sect " -t " title "; } >" title "." sect
name = synop = desc = sect = ""
diff --git a/src2man.1 b/src2man.1
index 4d3a94e..c1fd189 100644
--- a/src2man.1
+++ b/src2man.1
@@ -1,5 +1,5 @@
-." Text automatically generated by txt2man
-.TH src2man 1 "21 March 2007" "txt2man-1.5.5" ""
+.\" Text automatically generated by txt2man
+.TH src2man 1 "16 March 2011" "txt2man-1.5.6" ""
.SH NAME
\fBsrc2man \fP- extract man pages from source files.
.SH SYNOPSIS
@@ -17,10 +17,7 @@ number, are converted into a man file, using \fBtxt2man\fP(1).
.PP
The first line of the comment block must contain the name of the
manpage, usually the function name, followed by a "-" and a short
-.TP
-.B
-description.
-The following lines are the "DESCRIPTION" section
+description. The following lines are the "DESCRIPTION" section
content, except if they are in upper case, in which case they define
a new section.
.PP
@@ -28,10 +25,7 @@ If the next line after a comment block is empty, Then no "SYNOPSIS"
section will be generated. Otherwise, \fBsrc2man\fP will look in the following
source lines for a function prototype or a type definion (struct,
union, typedef, \.\.\.) matching the manpage name, and include it in a
-.TP
-.B
-"SYNOPSIS" section.
-This avoids to duplicate the type or function
+"SYNOPSIS" section. This avoids to duplicate the type or function
prototype in the comment block.
.PP
The best place for code documentation is in the source file, where
diff --git a/txt2man b/txt2man
index d6a0686..9ca9fcc 100755
--- a/txt2man
+++ b/txt2man
@@ -18,7 +18,7 @@ test "$HOME" = ~ || exec ksh $0 "$@" # try ksh if sh too old (not yet POSIX)
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-# release 1.5.5
+# release 1.5.6
usage()
{
@@ -131,18 +131,18 @@ post=cat
while getopts :d:hpTXr:s:t:v:P:I:B: opt
do
case $opt in
- d) date=$OPTARG;;
- r) rel=$OPTARG;;
- t) title=$OPTARG;;
- s) section=$OPTARG;;
- v) volume=$OPTARG;;
- P) sys=$OPTARG;;
- p) doprobe=1;;
- I) itxt="$OPTARG�$itxt";;
- B) btxt=$OPTARG;;
- T) post="groff -mandoc -Tlatin1 | ${PAGER:-more}";;
- X) post="groff -mandoc -X";;
- *) usage; exit;;
+ (d) date=$OPTARG;;
+ (r) rel=$OPTARG;;
+ (t) title=$OPTARG;;
+ (s) section=$OPTARG;;
+ (v) volume=$OPTARG;;
+ (P) sys=$OPTARG;;
+ (p) doprobe=1;;
+ (I) itxt="$OPTARG�$itxt";;
+ (B) btxt=$OPTARG;;
+ (T) post="groff -mandoc -Tlatin1 | ${PAGER:-more}";;
+ (X) post="groff -mandoc -X";;
+ (*) usage; exit;;
esac
done
shift $(($OPTIND - 1))
@@ -163,7 +163,7 @@ then
rel=$(pwd | sed 's:/.*[^0-9]/::g; s:/.*::g')
fi
-head=".\\\" Text automatically generated by txt2man
+head="\" Text automatically generated by txt2man
.TH $title $section \"$date\" \"$rel\" \"$volume\""
# All tabs converted to spaces
@@ -171,7 +171,7 @@ expand $* |
# gawk is needed because use of non standard regexp
gawk --re-interval -v head="$head" -v itxt="$itxt" -v btxt="$btxt" '
BEGIN {
- print head
+ print ".\\" head
avar[1] = btxt; avar[2] = itxt
for (k in avar) {
mark = (k == 1) ? "\\fB" : "\\fI"
@@ -187,7 +187,7 @@ BEGIN {
}
{
# to avoid some side effects in regexp
- sub(/\.\.\./, "\\.\\.\\.")
+ gsub(/\.\.\./, "\\.\\.\\.")
# remove spaces in empty lines
sub(/^ +$/,"")
}
@@ -311,8 +311,9 @@ section == "SYNOPSIS" {
}
}
# word attributes
- for (i in subwords)
- gsub(i, subwords[i])
+ n = asorti(subwords, indices)
+ for (i = 1; i <= n; i++)
+ gsub(indices[i], subwords[indices[i]])
# shell options
gsub(/\B\-+\w+(\-\w+)*/, "\\fB&\\fP")
# unprotect dots inside words
@@ -365,6 +366,8 @@ section == "SYNOPSIS" {
}
if (section != "SYNOPSIS" || $0 ~ /^ {1,4}/)
sub(/ */,"")
+ # Protect lines starting by simple quotes
+ sub(/^'\''/, "\\(cq")
print
}
diff --git a/txt2man.1 b/txt2man.1
index ac4b96d..a0fc785 100644
--- a/txt2man.1
+++ b/txt2man.1
@@ -1,5 +1,5 @@
-." Text automatically generated by txt2man
-.TH txt2man 1 "21 March 2007" "txt2man-1.5.5" ""
+.\" Text automatically generated by txt2man
+.TH txt2man 1 "16 March 2011" "txt2man-1.5.6" ""
.SH NAME
\fBtxt2man \fP- convert flat ASCII text to man page format
.SH SYNOPSIS
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/txt2man.git
More information about the Reproducible-commits
mailing list