Skip to content

Commit c915404

Browse files
committed
Fix pm_to_blib for VMS
154730c broke the core build on VMS. The one-liner is not parseable and it turns out to be due to a bug in the make utility (MMK) wherein the comment character ('#') does not get ignored within a quoted string on a continuation line (it's fine on the first line of a rule). So squirrel away $#ARGV and its '#' character in another variable on the first line, where it causes no trouble, then use the substitute on the second line. Also, replace literal quote characters with the q operator where it's easy to do so; it's a lot easier to read and debug the generated code if you don't have to think about all of the quoting and escaping and interpolation rules regarding single and double quotes for Perl, the make utility, and the shell all at once.
1 parent 1ac2de7 commit c915404

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ExtUtils/MM_Unix.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,10 +3191,10 @@ pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM)
31913191

31923192
# VMS will swallow '' and PM_FILTER is often empty. So use q[]
31933193
my $pm_to_blib = $self->oneliner(<<CODE, ['-MExtUtils::Install']);
3194-
\$i=0; \$i++ until \$i > \$#ARGV or \$ARGV[\$i] eq "--";
3195-
die "Failed to find -- in ".join("|",\@ARGV) if \$i > \$#ARGV;
3194+
\$i=0; \$n=\$#ARGV; \$i++ until \$i > \$n or \$ARGV[\$i] eq q{--};
3195+
die q{Failed to find -- in }.join(q{|},\@ARGV) if \$i > \$n;
31963196
\@parts=splice \@ARGV,0,\$i+1;
3197-
pop \@parts; \$filter=join " ", map qq{"\$_"}, \@parts;
3197+
pop \@parts; \$filter=join q{ }, map qq{"\$_"}, \@parts;
31983198
pm_to_blib({\@ARGV}, '$autodir', \$filter, '\$(PERM_DIR)')
31993199
CODE
32003200
$pm_to_blib .= q[ $(PM_FILTER) --];

0 commit comments

Comments
 (0)