On Oct 6, 2010, at 7:44 AM, Nicholas Clark wrote:

On Wed, Oct 06, 2010 at 07:36:56AM -0500, Craig A. Berry wrote:

Making all in cpan/Pod-LaTeX
MMK "all" /DESCRIPTION=descrip.mms /MACRO=("PERL_CORE=1")
%MMK-W-CIRCDEP, circular dependency found for target POD2LATEX.PL

I corrected this with:

commit 9ed9b795caa408a925999e1d90f9932e35b3ab10
Author: Craig A. Berry <craigbe...@mac.com>
Date:   Wed Oct 6 19:19:33 2010 -0500

    No distinction between .PL and .pl if case is not preserved.

    Follow-up to 13b5e8d8173af2197798ae78b4520ece8cb1151c.

    On VMS, the CRTL downcases filenames by default, so pod2foo.PL
    comes through as pod2foo.pl.  We need to match that so we paste
    on the right extension for the generated command procedure.

diff --git a/make_ext.pl b/make_ext.pl
index 8f3e6db..3c25b28 100644
--- a/make_ext.pl
+++ b/make_ext.pl
@@ -387,7 +387,7 @@ my $script_ext = $^O eq 'VMS' ? '.com' : '';
 my %%pod_scripts;
 foreach (glob('pod*.PL')) {
     my $script = $_;
-    s/.PL$/$script_ext/;
+    s/.PL$/$script_ext/i;
     $pod_scripts{$script} = $_;
 }
 my @exe_files = values %%pod_scripts;

Forewarned is forearmed - to my mind the next logical thing is to migrate building of CPAN-supplied "scripts" from utils/*.PL into their cpan/ (etc) builds. Currently I can see that (say) utils/cpan.PL extracts to cpan.com
on VMS. Does MakeMaker do the same thing - does building from the CPAN
source tarball generate [blib.scripts]cpan.com  ? Or does it generate
[blib.scripts]cpan  ?


It doesn't generate anything per se. It copies [.scripts]cpan as distributed with the module to [.blib.script]cpan, then runs Extutils::MakeMaker::MM_Unix->fixin on the result, which (incorrectly on VMS) pastes a shebang line on the beginning, replacing any shebang line already there. This based on building CPAN 1.94_61 just now.

In the core, utils/cpan.PL is simply a wrapper that sucks in cpan/CPAN/ scripts/cpan, puts $Config{startperl} at the beginning, and writes it back out. There are a bunch of these that all have identical code except for the name of the utility, so one obvious rationalization would be to put that code in one script and have it work through a list of utilities to be generated.

fixin() and the various *.PL scripts in utils have two different understandings of what $Config{startperl} is and how to use it. The .PL scripts have it right as far as VMS is concerned, so it looks like we need to fix fixin().


Side note: this extraction process in the core is a bit strange on Unix. You end up with two shebang lines in the utilities distributed with the core:

#!/usr/local/bin/perl
    eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
        if $running_under_some_shell;
#!/usr/local/bin/perl
. . .

I assume the first one takes precedence since the second one will never be seen by the shell.

________________________________________
Craig A. Berry
mailto:craigbe...@mac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Reply via email to