[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Mon Mar 6 20:38:23 UTC 2017


The branch master has been updated
       via  cadb015b021065640c7ae02c5eefa0e04cdbd45e (commit)
       via  579a6745337fe8dc4ce34fac6367fa197a7cc219 (commit)
      from  c1074ce096e98d3175292cbd2240ead7f1f67b32 (commit)


- Log -----------------------------------------------------------------
commit cadb015b021065640c7ae02c5eefa0e04cdbd45e
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 6 21:17:32 2017 +0100

    Unix Makefile: Have manual generation use the same perl script as Windows and VMS
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2863)

commit 579a6745337fe8dc4ce34fac6367fa197a7cc219
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 6 21:16:35 2017 +0100

    util/process_docs.pl: make it possible to add a suffix to man docs
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2863)

-----------------------------------------------------------------------

Summary of changes:
 Configurations/unix-Makefile.tmpl | 98 ++++-----------------------------------
 util/process_docs.pl              | 13 +++++-
 2 files changed, 21 insertions(+), 90 deletions(-)

diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 87a9e1b..01f5665 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -563,109 +563,29 @@ uninstall_runtime:
 	@ : {- output_on() unless windowsdll(); "" -}
 	-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
 
-# A method to extract all names from a .pod file
-# The first sed extracts everything between "=head1 NAME" and the next =head1
-# The perl command joins all the lines into one
-# The second sed removes the description and turns all commas into spaces
-# Voilà, you have a space separated list of names!
-EXTRACT_NAMES=sed -e '1,/^=head1  *NAME *$$/d;/^=head1/,$$d' | \
-              $(PERL) -p -0 -e 's/\n/ /g; END {print "\n"}' | \
-              sed -e 's/ - .*$$//;s/,/ /g'
-PROCESS_PODS=\
-	set -e; \
-	here=`cd $(SRCDIR); pwd`; \
-	point=$$here/util/point.sh; \
-	for ds in man1 man3 man5 man7 ; do \
-	    SEC=`echo $$ds | sed -e s/man//`; \
-	    for p in $(SRCDIR)/doc/$$ds/*.pod; do \
-		fn=`basename $$p .pod`; \
-		Name=$$fn; \
-		NAME=`echo $$fn | tr '[a-z]' '[A-Z]'`; \
-		suf=`eval "echo $$OUTSUFFIX"`; \
-		top=`eval "echo $$OUTTOP"`; \
-		$(PERL) $(SRCDIR)/util/mkdir-p.pl $$top/man$$SEC; \
-		echo "install $$p -> $$top/man$$SEC/$$fn$$suf"; \
-		cat $$p | eval "$$GENERATE" \
-			>  $$top/man$$SEC/$$fn$$suf; \
-		names=`cat $$p | $(EXTRACT_NAMES)`; \
-		( cd $$top/man$$SEC; \
-		  for n in $$names; do \
-		      comp_n="$$n"; \
-		      comp_fn="$$fn"; \
-		      case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
-			  comp_n=`echo "$$n" | tr '[A-Z]' '[a-z]'`; \
-			  comp_fn=`echo "$$fn" | tr '[A-Z]' '[a-z]'`; \
-			  ;; \
-		      esac; \
-		      if [ "$$comp_n" != "$$comp_fn" ]; then \
-			  echo "link $$top/man$$SEC/$$n$$suf -> $$top/man$$SEC/$$fn$$suf"; \
-			  PLATFORM=$(PLATFORM) $$point $$fn$$suf $$n$$suf; \
-		      fi; \
-		  done ); \
-	    done; \
-	done
-UNINSTALL_DOCS=\
-	set -e; \
-	here=`cd $(SRCDIR); pwd`; \
-	for ds in man1 man3 man5 man7 ; do \
-	    SEC=`echo $$ds | sed -e s/man//`; \
-	    for p in $(SRCDIR)/doc/$$ds/*.pod; do \
-		fn=`basename $$p .pod`; \
-		suf=`eval "echo $$OUTSUFFIX"`; \
-		top=`eval "echo $$OUTTOP"`; \
-		echo "$(RM) $$top/man$$SEC/$$fn$$suf"; \
-	        $(RM) $$top/man$$SEC/$$fn$$suf; \
-		names=`cat $$p | $(EXTRACT_NAMES)`; \
-		for n in $$names; do \
-		    comp_n="$$n"; \
-		    comp_fn="$$fn"; \
-		    case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
-			comp_n=`echo "$$n" | tr '[A-Z]' '[a-z]'`; \
-			comp_fn=`echo "$$fn" | tr '[A-Z]' '[a-z]'`; \
-			;; \
-		    esac; \
-		    if [ "$$comp_n" != "$$comp_fn" ]; then \
-			echo "$(RM) $$top/man$$SEC/$$n$$suf"; \
-			$(RM) $$top/man$$SEC/$$n$$suf; \
-		    fi; \
-		done; \
-		( $(RMDIR) $$top/man$$SEC 2>/dev/null || exit 0 ); \
-	    done; \
-	done
 
 install_man_docs:
 	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
 	@echo "*** Installing manpages"
-	@\
-	OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
-	OUTTOP="$(DESTDIR)$(MANDIR)"; \
-	GENERATE='pod2man --name=$$NAME --section=$$SEC --center=OpenSSL --release=$(VERSION)'; \
-	$(PROCESS_PODS)
+	$(PERL) $(SRCDIR)/util/process_docs.pl \
+		--destdir=$(DESTDIR)$(MANDIR) --type=man --suffix=$(MANSUFFIX)
 
 uninstall_man_docs:
 	@echo "*** Uninstalling manpages"
-	@\
-	OUTSUFFIX='.$${SEC}$(MANSUFFIX)'; \
-	OUTTOP="$(DESTDIR)$(MANDIR)"; \
-	$(UNINSTALL_DOCS)
+	$(PERL) $(SRCDIR)/util/process_docs.pl \
+		--destdir=$(DESTDIR)$(MANDIR) --type=man --suffix=$(MANSUFFIX) \
+		--remove
 
 install_html_docs:
 	@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
 	@echo "*** Installing HTML manpages"
-	@\
-	OUTSUFFIX='.$(HTMLSUFFIX)'; \
-	OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
-	GENERATE="pod2html --podroot=$(SRCDIR)/doc --htmldir=.. \
-			   --podpath=apps:crypto:ssl --title=\$$Name \
-		  | perl -pe 's|href=\"http://man.he.net/man|href=\"../man|g; s|href=\"(.*/man.*)(?<!\.html)\">|href=\"\$$1.html\">|g;'"; \
-	$(PROCESS_PODS)
+	$(PERL) $(SRCDIR)/util/process_docs.pl \
+		--destdir=$(DESTDIR)$(HTMLDIR) --type=html
 
 uninstall_html_docs:
 	@echo "*** Uninstalling manpages"
-	@\
-	OUTSUFFIX='.$(HTMLSUFFIX)'; \
-	OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
-	$(UNINSTALL_DOCS)
+	$(PERL) $(SRCDIR)/util/process_docs.pl \
+		--destdir=$(DESTDIR)$(HTMLDIR) --type=html --remove
 
 
 # Developer targets (note: these are only available on Unix) #########
diff --git a/util/process_docs.pl b/util/process_docs.pl
index edb7ca6..5db78d8 100644
--- a/util/process_docs.pl
+++ b/util/process_docs.pl
@@ -33,6 +33,8 @@ GetOptions(\%options,
            'destdir=s',         # Destination directory
            #'in=s@',             # Explicit files to process (ignores sourcedir)
            'type=s',            # The result type, 'man' or 'html'
+           'suffix:s',          # Suffix to add to the extension.
+                                # Only used with type=man
            'remove',            # To remove files rather than writing them
            'dry-run|n',         # Only output file names on STDOUT
            'debug|D+',
@@ -50,6 +52,8 @@ pod2usage(1) unless ( defined $options{section}
                       && defined $options{type}
                       && ($options{type} eq 'man'
                           || $options{type} eq 'html') );
+pod2usage(1) if ( $options{type} eq 'html'
+                  && defined $options{suffix} );
 
 if ($options{debug}) {
     print STDERR "DEBUG: options:\n";
@@ -59,6 +63,8 @@ if ($options{debug}) {
         if defined $options{destdir};
     print STDERR "DEBUG:   --type      = $options{type}\n"
         if defined $options{type};
+    print STDERR "DEBUG:   --suffix    = $options{suffix}\n"
+        if defined $options{suffix};
     foreach (sort @{$options{section}}) {
         print STDERR "DEBUG:   --section   = $_\n";
     }
@@ -87,7 +93,7 @@ foreach my $section (sort @{$options{section}}) {
 
         my $updir = updir();
         my $name = uc $podname;
-        my $suffix = { man  => ".$podinfo{section}",
+        my $suffix = { man  => ".$podinfo{section}".($options{suffix} // ""),
                        html => ".html" } -> {$options{type}};
         my $generate = { man  => "pod2man --name=$name --section=$podinfo{section} --center=OpenSSL --release=$config{version} \"$podpath\"",
                          html => "pod2html \"--podroot=$options{sourcedir}\" --htmldir=$updir --podpath=man1:man3:man5:man7 \"--infile=$podpath\" \"--title=$podname\""
@@ -174,6 +180,7 @@ B<process_docs.pl>
 [B<--sourcedir>=I<dir>]
 B<--destdir>=I<dir>
 B<--type>=B<man>|B<html>
+[B<--suffix>=I<suffix>]
 [B<--remove>]
 [B<--dry-run>|B<-n>]
 [B<--debug>|B<-D>]
@@ -206,6 +213,10 @@ Top directory where the resulting files should end up
 
 Type of output to produce.  Currently supported are man pages and HTML files.
 
+=item B<--suffix>=I<suffix>
+
+A suffix added to the extension.  Only valid with B<--type>=B<man>
+
 =item B<--remove>
 
 Instead of writing the files, remove them.


More information about the openssl-commits mailing list