[openssl-commits] [web] master update

Richard Levitte levitte at openssl.org
Sat Feb 28 22:25:40 UTC 2015

The branch master has been updated
       via  57e533a64bb709e57ab1b08ec3acfb6947760b4a (commit)
      from  c6e4b80f3c965a3d1e8e4d36b8227b22358611bc (commit)

- Log -----------------------------------------------------------------
commit 57e533a64bb709e57ab1b08ec3acfb6947760b4a
Author: Richard Levitte <richard at levitte.org>
Date:   Sat Feb 28 23:25:24 2015 +0100

    It seems that pod2html in more modern perl releases don't do title.
    The pod2html that comes with perl 5.14 will extract the title from the
    NAME section of the .pod file.  In perl 5.18, this is no longer the
    case, and pod2html has a new argument --title where this can be given
    The solution here is to test the behavior of pod2html, and if it
    doesn't produce a title automatically, we extract it ourselves (simple
    sed does it) and provide the resulting string to pod2html.


Summary of changes:
 run-pod2html.sh |   27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/run-pod2html.sh b/run-pod2html.sh
index b0e081e..0f96a4f 100755
--- a/run-pod2html.sh
+++ b/run-pod2html.sh
@@ -3,15 +3,40 @@ SRC=$1
+# Somewhere between perl version 5.15 and 5.18, pod2html stopped extracting the
+# title from the pod file's NAME section.  When that's the case, we need to do
+# that work ourselves and give pod2html the extracted title with --title.  --title
+# isn't available in earlier perl verions, so we need to test the behaviour to
+# decide how to act.
+=head1 NAME
+foo - bar
+=head1 SYNOPSIS
+if echo "$pod2html_testtext" | pod2html | grep -q '^<title></title>$'; then
+    extract_title=true
+# Test done.
 for SUB in apps crypto ssl; do
     rm -rf $DIR
     mkdir -p $DIR
     for IN in $SRC/$SUB/*.pod; do
 	FN=`basename $IN .pod`
+	title_arg=''
+	if $extract_title; then
+	    title_arg="--title=`cat $IN | sed -e '1,/^=head1 NAME/d' -e '/^=/,$d' -e '/^\s*$/d'`"
+	fi
 	cat $IN \
 	| sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
-	| pod2html --podroot=$SRC --css=/manpage.css --htmlroot=/docs --podpath=$SUB:apps:crypto:ssl \
+	| pod2html --podroot=$SRC --css=/manpage.css --htmlroot=/docs --podpath=$SUB:apps:crypto:ssl "$title_arg" \
 	| sed -r 's/<!DOCTYPE.*//g' > $DIR/$FN.html
 	for L in `perl $HERE/getnames.pl $IN` ; do
 	    ln $DIR/$FN.html $DIR/$L.html || echo FAIL $DIR/$FN.html $DIR/$L.html

More information about the openssl-commits mailing list