Make pod2html a regular script without substitutions
authorFlorian Ragwitz <rafl@debian.org>
Thu, 25 Aug 2011 15:50:26 +0000 (17:50 +0200)
committerFlorian Ragwitz <rafl@debian.org>
Sat, 27 Aug 2011 10:46:15 +0000 (12:46 +0200)
This will make the CPAN dist easier. For the perl core, we still need
substitutions to get the right she-bang as we don't go through EU::MM to fix it
for us. For that, we add utils/pod2html.PL.

MANIFEST
ext/Pod-Html/bin/pod2html [moved from ext/Pod-Html/pod2html.PL with 63% similarity]
t/porting/known_pod_issues.dat
utils/Makefile
utils/Makefile.SH
utils/pod2html.PL [new file with mode: 0644]
vms/descrip_mms.template
win32/Makefile
win32/makefile.mk

index 8abe439..05a31b2 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -3606,8 +3606,8 @@ ext/PerlIO-via/hints/aix.pl       Hint for PerlIO::via for named architecture
 ext/PerlIO-via/t/via.t         See if PerlIO::via works
 ext/PerlIO-via/via.pm          PerlIO layer for layers in perl
 ext/PerlIO-via/via.xs          PerlIO layer for layers in perl
+ext/Pod-Html/bin/pod2html      Translator to turn pod into HTML
 ext/Pod-Html/lib/Pod/Html.pm   Convert POD data to HTML
-ext/Pod-Html/pod2html.PL       Precursor for translator to turn pod into HTML
 ext/Pod-Html/t/htmlescp.pod    pod2html escape test input data
 ext/Pod-Html/t/htmlescp.t      pod2html escape test
 ext/Pod-Html/t/htmllink.pod    pod2html link test input data
@@ -5231,6 +5231,7 @@ utils/perldoc.PL          A simple tool to find & display perl's documentation
 utils/perlivp.PL               installation verification procedure
 utils/piconv.PL                        iconv(1), reinvented in perl
 utils/pl2pm.PL                 A pl to pm translator
+utils/pod2html.PL              Translator to turn pod into HTML
 utils/prove.PL                 The prove harness utility
 utils/ptardiff.PL              The ptardiff utility
 utils/ptargrep.PL              The ptargrep utility
similarity index 63%
rename from ext/Pod-Html/pod2html.PL
rename to ext/Pod-Html/bin/pod2html
index 366dc16..9f4081a 100644 (file)
@@ -1,39 +1,3 @@
-#!/usr/local/bin/perl
-
-use Config;
-use File::Basename qw(&basename &dirname);
-use Cwd;
-
-# List explicitly here the variables you want Configure to
-# generate.  Metaconfig only looks for shell variables, so you
-# have to mention them as if they were shell variables, not
-# %Config entries.  Thus you write
-#  $startperl
-# to ensure Configure will look for $Config{startperl}.
-
-# This forces PL files to create target in same directory as PL file.
-# This is so that make depend always knows where to find PL derivatives.
-$origdir = cwd;
-chdir dirname($0);
-$file = basename($0, '.PL');
-$file .= '.com' if $^O eq 'VMS';
-
-open OUT,">$file" or die "Can't create $file: $!";
-
-print "Extracting $file (with variable substitutions)\n";
-
-# In this section, perl variables will be expanded during extraction.
-# You can use $Config{...} to use Configure variables.
-
-print OUT <<"!GROK!THIS!";
-$Config{startperl}
-    eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
-       if \$running_under_some_shell;
-!GROK!THIS!
-
-# In the following, perl variables are not expanded during extraction.
-
-print OUT <<'!NO!SUBS!';
 =pod
 
 =head1 NAME
@@ -175,9 +139,3 @@ This program is distributed under the Artistic License.
 use Pod::Html;
 
 pod2html @ARGV;
-!NO!SUBS!
-
-close OUT or die "Can't close $file: $!";
-chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
-exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
-chdir $origdir;
index b6f55d3..dc81bd8 100644 (file)
@@ -181,6 +181,7 @@ ext/file-glob/glob.pm       Verbatim line length including indents exceeds 79 by    15
 ext/hash-util-fieldhash/lib/hash/util/fieldhash.pm     Verbatim line length including indents exceeds 79 by    2
 ext/i18n-langinfo/langinfo.pm  Verbatim line length including indents exceeds 79 by    1
 ext/opcode/opcode.pm   Verbatim line length including indents exceeds 79 by    10
+ext/pod-html/bin/pod2html      Pod NAME already used   1
 ext/posix/lib/posix.pod        Verbatim line length including indents exceeds 79 by    29
 ext/re/re.pm   Verbatim line length including indents exceeds 79 by    6
 ext/vms-dclsym/dclsym.pm       ? Should you be using L<...> instead of 1
@@ -294,6 +295,7 @@ porting/release_schedule.pod        There is no NAME        1
 symbian/perlutil.pod   Verbatim line length including indents exceeds 79 by    4
 utils/c2ph     Verbatim line length including indents exceeds 79 by    44
 utils/libnetcfg        Apparent broken link    1
+utils/pod2html Pod NAME already used   1
 vms/ext/filespec.pm    Verbatim line length including indents exceeds 79 by    1
 x2p/a2p.pod    empty section in previous paragraph     2
 lib/benchmark.pm       Verbatim line length including indents exceeds 79 by    4
index 5506a14..a3a5540 100644 (file)
@@ -10,9 +10,9 @@ RUN =   # Used mainly cross-compilation setups.
 # Files to be built with variable substitution after miniperl is
 # available.  Dependencies handled manually below (for now).
 
-pl = c2ph.PL config_data.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL json_pp.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL ptargrep.PL cpanp-run-perl.PL cpanp.PL cpan2dist.PL shasum.PL splain.PL libnetcfg.PL piconv.PL enc2xs.PL xsubpp.PL
-plextract = c2ph config_data corelist cpan h2ph h2xs instmodsh json_pp perlbug perldoc perlivp pl2pm prove ptar ptardiff ptargrep cpanp-run-perl cpanp cpan2dist shasum splain libnetcfg piconv enc2xs xsubpp
-plextractexe = ./c2ph ./config_data ./corelist ./cpan ./h2ph ./h2xs ./json_pp ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./ptargrep ./cpanp-run-perl ./cpanp ./cpan2dist ./shasum ./splain ./libnetcfg ./piconv ./enc2xs ./xsubpp
+pl = c2ph.PL config_data.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL json_pp.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL ptargrep.PL cpanp-run-perl.PL cpanp.PL cpan2dist.PL shasum.PL splain.PL libnetcfg.PL piconv.PL enc2xs.PL xsubpp.PL pod2html.PL
+plextract = c2ph config_data corelist cpan h2ph h2xs instmodsh json_pp perlbug perldoc perlivp pl2pm prove ptar ptardiff ptargrep cpanp-run-perl cpanp cpan2dist shasum splain libnetcfg piconv enc2xs xsubpp pod2html
+plextractexe = ./c2ph ./config_data ./corelist ./cpan ./h2ph ./h2xs ./json_pp ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./ptargrep ./cpanp-run-perl ./cpanp ./cpan2dist ./shasum ./splain ./libnetcfg ./piconv ./enc2xs ./xsubpp ./pod2html
 
 all: $(plextract) 
 
@@ -69,6 +69,8 @@ enc2xs:               enc2xs.PL ../config.sh
 
 xsubpp:                xsubpp.PL ../config.sh
 
+pod2html:      pod2html.PL ../config.sh ../ext/Pod-Html/bin/pod2html
+
 clean:
 
 realclean:
index f4daec2..1942ec8 100644 (file)
@@ -48,9 +48,9 @@ cat >>Makefile <<'!NO!SUBS!'
 # Files to be built with variable substitution after miniperl is
 # available.  Dependencies handled manually below (for now).
 
-pl = c2ph.PL config_data.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL json_pp.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL ptargrep.PL cpanp-run-perl.PL cpanp.PL cpan2dist.PL shasum.PL splain.PL libnetcfg.PL piconv.PL enc2xs.PL xsubpp.PL
-plextract = c2ph config_data corelist cpan h2ph h2xs instmodsh json_pp perlbug perldoc perlivp pl2pm prove ptar ptardiff ptargrep cpanp-run-perl cpanp cpan2dist shasum splain libnetcfg piconv enc2xs xsubpp
-plextractexe = ./c2ph ./config_data ./corelist ./cpan ./h2ph ./h2xs ./json_pp ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./ptargrep ./cpanp-run-perl ./cpanp ./cpan2dist ./shasum ./splain ./libnetcfg ./piconv ./enc2xs ./xsubpp
+pl = c2ph.PL config_data.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL json_pp.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL ptargrep.PL cpanp-run-perl.PL cpanp.PL cpan2dist.PL shasum.PL splain.PL libnetcfg.PL piconv.PL enc2xs.PL xsubpp.PL pod2html.PL
+plextract = c2ph config_data corelist cpan h2ph h2xs instmodsh json_pp perlbug perldoc perlivp pl2pm prove ptar ptardiff ptargrep cpanp-run-perl cpanp cpan2dist shasum splain libnetcfg piconv enc2xs xsubpp pod2html
+plextractexe = ./c2ph ./config_data ./corelist ./cpan ./h2ph ./h2xs ./json_pp ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./ptargrep ./cpanp-run-perl ./cpanp ./cpan2dist ./shasum ./splain ./libnetcfg ./piconv ./enc2xs ./xsubpp ./pod2html
 
 all: $(plextract) 
 
@@ -107,6 +107,8 @@ enc2xs:             enc2xs.PL ../config.sh
 
 xsubpp:                xsubpp.PL ../config.sh
 
+pod2html:      pod2html.PL ../config.sh ../ext/Pod-Html/bin/pod2html
+
 clean:
 
 realclean:
diff --git a/utils/pod2html.PL b/utils/pod2html.PL
new file mode 100644 (file)
index 0000000..696624f
--- /dev/null
@@ -0,0 +1,53 @@
+#!/usr/local/bin/perl
+
+use Config;
+use File::Basename qw(&basename &dirname);
+use Cwd;
+
+# List explicitly here the variables you want Configure to
+# generate.  Metaconfig only looks for shell variables, so you
+# have to mention them as if they were shell variables, not
+# %Config entries.  Thus you write
+#  $startperl
+# to ensure Configure will look for $Config{startperl}.
+
+# This forces PL files to create target in same directory as PL file.
+# This is so that make depend always knows where to find PL derivatives.
+my $origdir = cwd;
+chdir dirname($0);
+my $file = basename($0, '.PL');
+$file .= '.com' if $^O eq 'VMS';
+
+open OUT,">$file" or die "Can't create $file: $!";
+
+print "Extracting $file (with variable substitutions)\n";
+
+# In this section, perl variables will be expanded during extraction.
+# You can use $Config{...} to use Configure variables.
+
+print OUT <<"!GROK!THIS!";
+$Config{startperl}
+    eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
+       if \$running_under_some_shell;
+!GROK!THIS!
+
+use File::Spec;
+
+my $script = File::Spec->catfile(
+    File::Spec->catdir(
+        File::Spec->updir, qw(ext Pod-Html bin),
+    ),
+    'pod2html',
+);
+
+if (open(IN, $script)) {
+    print OUT <IN>;
+    close IN;
+} else {
+    die "$0: cannot find '$script'\n";
+}
+
+close OUT or die "Can't close $file: $!";
+chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
+exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
+chdir $origdir;
index afd6cf3..cef3716 100644 (file)
@@ -359,7 +359,7 @@ LIBPREREQ = $(ARCHDIR)Config.pm $(ARCHDIR)Config_heavy.pl [.lib.VMS]Filespec.pm
 
 utils1 = [.utils]perldoc.com [.lib.ExtUtils]Miniperl.pm [.utils]c2ph.com [.utils]h2ph.com 
 utils2 = [.utils]h2xs.com [.utils]libnetcfg.com [.lib]perlbug.com [.utils]json_pp.com
-utils3 = [.utils]perlivp.com [.lib]splain.com [.utils]pl2pm.com [.utils]xsubpp.com [.utils]instmodsh.com
+utils3 = [.utils]perlivp.com [.lib]splain.com [.utils]pl2pm.com [.utils]xsubpp.com [.utils]pod2html.com [.utils]instmodsh.com
 utils4 = [.utils]enc2xs.com [.utils]piconv.com [.utils]cpan.com [.utils]prove.com [.utils]ptar.com [.utils]ptardiff.com [.utils]shasum.com
 utils5 = [.utils]corelist.com [.utils]config_data.com [.utils]cpanp.com [.utils]cpan2dist.com [.utils]cpanp-run-perl.com [.utils]ptargrep.com
 
@@ -609,6 +609,9 @@ nonxsext : $(LIBPREREQ) preplibrary $(MINIPERL_EXE)
 [.utils]xsubpp.com : [.utils]xsubpp.PL $(ARCHDIR)Config.pm nonxsext
        $(MINIPERL) -"I[-.lib]" $(MMS$SOURCE)
 
+[.utils]pod2html.com : [.utils]pod2html.PL $(ARCHDIR)Config.pm nonxsext
+       $(MINIPERL) -"I[-.lib]" $(MMS$SOURCE)
+
 # Rename catches problem with some DECC versions in which object file is
 # placed in current default dir, not same one as source file.
 [.x2p]$(DBG)a2p$(E) : [.x2p]a2p$(O), [.x2p]hash$(O), [.x2p]str$(O), [.x2p]util$(O), [.x2p]walk$(O)
index 8f7905f..5fd2f98 100644 (file)
@@ -588,6 +588,7 @@ UTILS               =                       \
                ..\utils\shasum         \
                ..\utils\instmodsh      \
                ..\utils\json_pp        \
+               ..\utils\pod2html       \
                ..\x2p\find2perl        \
                ..\x2p\psed             \
                ..\x2p\s2p              \
@@ -1178,7 +1179,7 @@ distclean: realclean
            perlvos.pod perlwin32.pod
        -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
            perldoc perlivp libnetcfg enc2xs piconv cpan *.bat \
-           xsubpp instmodsh json_pp prove ptar ptardiff ptargrep cpanp-run-perl cpanp cpan2dist shasum corelist config_data
+           xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep cpanp-run-perl cpanp cpan2dist shasum corelist config_data
        -cd ..\x2p && del /f find2perl s2p psed *.bat
        -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
                perlmainst.c
index 2d814ec..945ca9e 100644 (file)
@@ -748,6 +748,7 @@ UTILS               =                       \
                ..\utils\corelist       \
                ..\utils\cpan           \
                ..\utils\xsubpp         \
+               ..\utils\pod2html       \
                ..\utils\prove          \
                ..\utils\ptar           \
                ..\utils\ptardiff       \
@@ -1548,7 +1549,7 @@ distclean: realclean
            perlvos.pod perlwin32.pod
        -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
            perldoc perlivp libnetcfg enc2xs piconv cpan *.bat \
-           xsubpp instmodsh json_pp prove ptar ptardiff ptargrep cpanp-run-perl cpanp cpan2dist shasum corelist config_data
+           xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep cpanp-run-perl cpanp cpan2dist shasum corelist config_data
        -cd ..\x2p && del /f find2perl s2p psed *.bat
        -del /f ..\config.sh perlmain.c dlutils.c config.h.new \
            perlmainst.c