[med-svn] [Git][med-team/community/helper-scripts][master] createmanges: Extra cecks, extra hardening, extra verbosity

Steffen Möller (@moeller) gitlab at salsa.debian.org
Mon May 24 00:35:40 BST 2021



Steffen Möller pushed to branch master at Debian Med / community / helper-scripts


Commits:
6b986101 by Steffen Moeller at 2021-05-24T01:35:30+02:00
createmanges: Extra cecks, extra hardening, extra verbosity

- - - - -


1 changed file:

- createmanpages


Changes:

=====================================
createmanpages
=====================================
@@ -1,10 +1,34 @@
 #!/bin/sh
+
+set -e
+
+if [ ! -x /usr/bin/help2man ]; then
+    echo "E: Missing /usr/bin/help2man, please install it from the cognate package."
+    exit 1
+fi
+
+if [ ! -n "$NAME" ]; then
+    NAME=`grep "^Description:" debian/control | sed 's/^Description: *//' | head -n1`
+fi
+
+if [ ! -n "$VERSION" ]; then
+    VERSION=`dpkg-parsechangelog | awk '/^Version:/ {print $2}' | sed -e 's/^[0-9]*://' -e 's/-.*//' -e 's/[+~]dfsg$//'`
+fi
+
+if [ ! -n "$PROGNAME" ]; then
+    PROGNAME=`grep "^Package:" debian/control | sed 's/^Package: *//' | head -n1`
+fi
+
 MANDIR=debian
+
+echo "PROGNAME: '$PROGNAME'"
+echo "NAME:     '$NAME'"
+echo "VERSION:  '$VERSION'"
+echo "MANDIR:   '$MANDIR'"
+echo "HELPOPTION: '$HELPOPTION'"
+
 mkdir -p $MANDIR
 
-VERSION=`dpkg-parsechangelog | awk '/^Version:/ {print $2}' | sed -e 's/^[0-9]*://' -e 's/-.*//' -e 's/[+~]dfsg$//'`
-NAME=`grep "^Description:" debian/control | sed 's/^Description: *//' | head -n1`
-PROGNAME=`grep "^Package:" debian/control | sed 's/^Package: *//' | head -n1`
 
 AUTHOR=".SH AUTHOR\n \
 This manpage was written by $DEBFULLNAME for the Debian distribution and\n \
@@ -14,7 +38,7 @@ can be used for any other usage of the program.\
 # If program name is different from package name or title should be
 # different from package short description change this here
 progname=${PROGNAME}
-help2man --no-info --no-discard-stderr --help-option=" " \
+help2man --no-info --no-discard-stderr --help-option="$HELPOPTION" \
          --name="$NAME" \
             --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
 echo $AUTHOR >> $MANDIR/${progname}.1
@@ -22,7 +46,9 @@ echo $AUTHOR >> $MANDIR/${progname}.1
 echo "$MANDIR/*.1" > debian/manpages
 
 cat <<EOT
-Please enhance the help2man output.
+Please enhance the help2man output in '$MANDIR/${progname}.1'.
+To inspect it, try 'nroff -man $MANDIR/${progname}.1'.
+If very unhappy, try passing the HELPOPTION as an environment variable.
 The following web page might be helpful in doing so:
     http://liw.fi/manpages/
 EOT



View it on GitLab: https://salsa.debian.org/med-team/community/helper-scripts/-/commit/6b9861012ee906f605e768eb1a6560d6592e68fb

-- 
View it on GitLab: https://salsa.debian.org/med-team/community/helper-scripts/-/commit/6b9861012ee906f605e768eb1a6560d6592e68fb
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210523/25db784a/attachment-0001.htm>


More information about the debian-med-commit mailing list