summaryrefslogtreecommitdiff
path: root/cpan
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2011-01-23 18:33:01 -0600
committerCraig A. Berry <craigberry@mac.com>2011-01-23 18:33:01 -0600
commit5844a3edbd3499c6a146436e1d7ec0648feacb5b (patch)
treec881e018ce09b2889df151bbfe5098ce79982a7d /cpan
parent613e98e463d92e7eb6bfa6d25de65632ece7d50f (diff)
downloadperl-5844a3edbd3499c6a146436e1d7ec0648feacb5b.tar.gz
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
Diffstat (limited to 'cpan')
-rw-r--r--cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm17
-rw-r--r--cpan/ExtUtils-MakeMaker/t/fixin.t23
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 642f2bab82..d6b63eba63 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 de5866a5c3..ab3a177b38 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(<<END,
#!/foo/bar/perl -w
@@ -71,8 +73,8 @@ blah blah blah
END
sub {
my @lines = @_;
- unlike $lines[0], qr[/foo/bar/perl], "#! replaced";
- like $lines[0], qr[ -w\b], "switch retained";
+ unlike $lines[$shb_line_num], qr[/foo/bar/perl], "#! replaced";
+ like $lines[$shb_line_num], qr[ -w\b], "switch retained";
# In between might be that "not running under some shell" madness.
@@ -90,8 +92,8 @@ END
sub {
my @lines = @_;
- unlike $lines[0], qr[/foo/bar/perl5.8.8], "#! replaced";
- like $lines[0], qr[ -w\b], "switch retained";
+ unlike $lines[$shb_line_num], qr[/foo/bar/perl5.8.8], "#! replaced";
+ like $lines[$shb_line_num], qr[ -w\b], "switch retained";
# In between might be that "not running under some shell" madness.
@@ -101,17 +103,20 @@ END
# fixin shouldn't pick this up.
-test_fixin(<<END,
+SKIP: {
+ skip "Not relevant on VMS", 4 if $^O eq 'VMS';
+ test_fixin(<<END,
#!/foo/bar/perly -w
blah blah blah
END
- sub {
- is join("", @_), <<END;
+ sub {
+ is join("", @_), <<END;
#!/foo/bar/perly -w
blah blah blah
END
- }
-);
+ }
+ );
+}