summaryrefslogtreecommitdiff
path: root/installperl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-08-30 14:32:36 +0000
committerNicholas Clark <nick@ccl4.org>2008-08-30 14:32:36 +0000
commit99d21f8bc43125eacfa8aced0256e0e27fb2201d (patch)
treeab5df3ddcfe0601fbf7eae2eff8af07781593c06 /installperl
parentd3133c8951f1251e8d76e1b8b31b8ec2ee12bc89 (diff)
downloadperl-99d21f8bc43125eacfa8aced0256e0e27fb2201d.tar.gz
Silence warnings when -destdir isn't set.
p4raw-id: //depot/perl@34235
Diffstat (limited to 'installperl')
-rwxr-xr-xinstallperl11
1 files changed, 8 insertions, 3 deletions
diff --git a/installperl b/installperl
index e496b06c09..f7e69b8aeb 100755
--- a/installperl
+++ b/installperl
@@ -67,6 +67,11 @@ if ( $Is_VMS ) {
}
$otherperls = 1;
+# This little hack simplifies making the code after the comment "Fetch some
+# frequently-used items from %Config" warning free. With $opts{destdir} always
+# defined, it's also possible to make the s/\Q$opts{destdir}\E unconditional.
+
+$opts{destdir} = '';
# Consider refactoring this to use Getopt::Long once Getopt::Long's planned
# feature is implemented, to distinguish + and - options.
while (@ARGV) {
@@ -681,7 +686,7 @@ sub copy {
my($from,$to) = @_;
my $xto = $to;
- $xto =~ s/^\Q$opts{destdir}\E// if $opts{destdir};
+ $xto =~ s/^\Q$opts{destdir}\E//;
print $opts{verbose} ? " cp $from $xto\n" : " $xto\n"
unless $opts{silent};
print " creating new version of $xto\n"
@@ -766,7 +771,7 @@ sub installlib {
unlink("$installarchlib/$name");
}
my $xname = "$installlib/$name";
- $xname =~ s/^\Q$opts{destdir}\E// if $opts{destdir};
+ $xname =~ s/^\Q$opts{destdir}\E//;
$packlist->{$xname} = { type => 'file' };
if ($force || compare($_, "$installlib/$name") || $opts{notify}) {
unlink("$installlib/$name");
@@ -813,7 +818,7 @@ sub copy_if_diff {
my($from,$to)=@_;
return 1 if (($^O eq 'VMS') && (-d $from));
my $xto = $to;
- $xto =~ s/^\Q$opts{destdir}\E// if $opts{destdir};
+ $xto =~ s/^\Q$opts{destdir}\E//;
my $perlpodbadsymlink;
if ($from =~ m!^pod/perl[\w-]+\.pod$! &&
-l $from &&