Subject: | ppd and hints problems on VMS |
This is a revision of a patch originally posted at
<http://www.xray.mpe.mpg.de/mailing-lists/makemaker/2002-09/msg00013.html>
Peter Prymmer pointed out that using \x22 for a double quote character would break on EBCDIC platforms. The revised patch attached here uses whatever the native double quote character is, unfortunately at a somewhat further loss of readability.
This does get the ppd target working properly with MM 6.05, Perl 5.8.0, OpenVMS Alpha v7.3.
--- lib/ExtUtils/MakeMaker.pm;-0 Tue Aug 27 18:10:58 2002
+++ lib/ExtUtils/MakeMaker.pm Sat Sep 14 15:34:42 2002
@@ -688,11 +688,11 @@
# Also try without trailing minor version numbers.
while (1) {
- last if -f File::Spec->catdir($hint_dir, "$hint.pl"); # found
+ last if -f File::Spec->catfile($hint_dir, "$hint.pl"); # found
} continue {
last unless $hint =~ s/_[^_]*$//; # nothing to cut off
}
- my $hint_file = File::Spec->catdir($hint_dir, "$hint.pl");
+ my $hint_file = File::Spec->catfile($hint_dir, "$hint.pl");
return unless -f $hint_file; # really there
--- lib/ExtUtils/MM_Unix.pm_orig Sat Sep 14 12:47:58 2002
+++ lib/ExtUtils/MM_Unix.pm Mon Sep 16 20:08:14 2002
@@ -3204,26 +3204,30 @@
$author =~ s/>/>/g;
$author =~ s/@/\\@/g;
- my $make_ppd = sprintf <<'PPD_OUT', $pack_ver, $abstract, $author;
+# Some folks "escape" quotes and others double them in order to get a double
+# quote inside of a double-quoted string seen by the shell.
+ my $dq = $^O eq 'VMS' ? '""' : '\"';
+
+ my $make_ppd = sprintf <<'PPD_OUT', $dq, $dq, "$dq$pack_ver$dq", $abstract, $author;
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd:
- @$(PERL) -e "print qq{<SOFTPKG NAME=\"$(DISTNAME)\" VERSION=\"%s\">\n\t<TITLE>$(DISTNAME)</TITLE>\n\t<ABSTRACT>%s</ABSTRACT>\n\t<AUTHOR>%s</AUTHOR>\n}" > $(DISTNAME).ppd
+ $(NOECHO) $(PERL) -e "print qq{<SOFTPKG NAME=%s$(DISTNAME)%s VERSION=%s>\n\t<TITLE>$(DISTNAME)</TITLE>\n\t<ABSTRACT>%s</ABSTRACT>\n\t<AUTHOR>%s</AUTHOR>\n}" > $(DISTNAME).ppd
PPD_OUT
- $make_ppd .= ' @$(PERL) -e "print qq{\t<IMPLEMENTATION>\n';
foreach my $prereq (sort keys %{$self->{PREREQ_PM}}) {
+ $make_ppd .= ' $(NOECHO) $(PERL) -e "print qq{\t<IMPLEMENTATION>\n';
my $pre_req = $prereq;
$pre_req =~ s/::/-/g;
my ($dep_ver) = join ",", (split (/\./, $self->{PREREQ_PM}{$prereq}),
(0) x 4) [0 .. 3];
- $make_ppd .= sprintf q{\t\t<DEPENDENCY NAME=\"%s\" VERSION=\"%s\" />\n}, $pre_req, $dep_ver;
+ $make_ppd .= sprintf q{\t\t<DEPENDENCY NAME=%s VERSION=%s />\n}, "$dq$pre_req$dq", "$dq$dep_ver$dq";
+ $make_ppd .= qq[}" >> \$(DISTNAME).ppd\n];
}
- $make_ppd .= qq[}" >> \$(DISTNAME).ppd\n];
- $make_ppd .= sprintf <<'PPD_OUT', $Config{archname};
- @$(PERL) -e "print qq{\t\t<OS NAME=\"$(OSNAME)\" />\n\t\t<ARCHITECTURE NAME=\"%s\" />\n
+ $make_ppd .= sprintf <<'PPD_OUT', $dq, $dq, "$dq$Config{archname}$dq";
+ $(NOECHO) $(PERL) -e "print qq{\t\t<OS NAME=%s$(OSNAME)%s />\n\t\t<ARCHITECTURE NAME=%s />\n
PPD_OUT
chomp $make_ppd;
@@ -3231,8 +3235,8 @@
if ($self->{PPM_INSTALL_SCRIPT}) {
if ($self->{PPM_INSTALL_EXEC}) {
- $make_ppd .= sprintf q{\t\t<INSTALL EXEC=\"%s\">%s</INSTALL>\n},
- $self->{PPM_INSTALL_EXEC}, $self->{PPM_INSTALL_SCRIPT};
+ $make_ppd .= sprintf q{\t\t<INSTALL EXEC=%s>%s</INSTALL>\n},
+ "$dq$self->{PPM_INSTALL_EXEC}$dq", "$dq$self->{PPM_INSTALL_SCRIPT}$dq";
}
else {
$make_ppd .= sprintf q{\t\t<INSTALL>%s</INSTALL>\n},
@@ -3243,7 +3247,7 @@
my ($bin_location) = $self->{BINARY_LOCATION} || '';
$bin_location =~ s/\\/\\\\/g;
- $make_ppd .= sprintf q{\t\t<CODEBASE HREF=\"%s\" />\n}, $bin_location;
+ $make_ppd .= sprintf q{\t\t<CODEBASE HREF=%s />\n}, "$dq$bin_location$dq";
$make_ppd .= q{\t</IMPLEMENTATION>\n};
$make_ppd .= q{</SOFTPKG>\n};