From 5844a3edbd3499c6a146436e1d7ec0648feacb5b Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" Date: Sun, 23 Jan 2011 18:33:01 -0600 Subject: [PATCH] Override _fixin_replace_shebang on VMS so MM->fixin works. Script generation doesn't look like it's ever worked on VMS, but this hasn't been that big a deal because all the utilities distributed with the core have their own generation facilities under utils/. However, Nicholas wants to put that directory on a diet and have the scripts be generated by the modules that own them. So we have to get script generation via MM->fixin working, and we do that here by prepending the same $Config{startperl} incantation to the shebang line that we've been using in core for eons. Tracks upstream commit: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/14ff930dd862286d6dafe4228b3a72415b5df9a5 --- cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm | 17 +++++++++++++++++ cpan/ExtUtils-MakeMaker/t/fixin.t | 23 ++++++++++++++--------- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm index 642f2ba..d6b63eb 100644 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm @@ -248,6 +248,23 @@ sub find_perl { 0; # false and not empty } +=item _fixin_replace_shebang (override) + +Helper routine for MM->fixin(), overridden because there's no such thing as an +actual shebang line that will be intepreted by the shell, so we just prepend +$Config{startperl} and preserve the shebang line argument for any switches it +may contain. + +=cut + +sub _fixin_replace_shebang { + my ( $self, $file, $line ) = @_; + + my ( undef, $arg ) = split ' ', $line, 2; + + return $Config{startperl} . "\n" . $Config{sharpbang} . "perl $arg\n"; +} + =item maybe_command (override) Follows VMS naming conventions for executable files. diff --git a/cpan/ExtUtils-MakeMaker/t/fixin.t b/cpan/ExtUtils-MakeMaker/t/fixin.t index de5866a..ab3a177 100644 --- a/cpan/ExtUtils-MakeMaker/t/fixin.t +++ b/cpan/ExtUtils-MakeMaker/t/fixin.t @@ -64,6 +64,8 @@ sub test_fixin { # A simple test of fixin +# On VMS, the shebang line comes after the startperl business. +my $shb_line_num = $^O eq 'VMS' ? 2 : 0; test_fixin(<