This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Time-HiRes: fix a do/@INC issue in Makefile.PL
authorDavid Mitchell <davem@iabyn.com>
Mon, 22 May 2017 08:37:31 +0000 (09:37 +0100)
committerDavid Mitchell <davem@iabyn.com>
Mon, 22 May 2017 08:37:31 +0000 (09:37 +0100)
The code assumed that File::Spec->catfile(".", ...) would create a
"./" prefix in the pathname that is fed to do(), but it turns out
catfile() doesn't work like that.

This didn't affect perl builds since Makefile.PL is normally run by
miniperl, which *does* have '.' in @INC. But it you tried to build
Time-HiRes manually, it would fail.

[ This commit is half of a diff proposed by James E Keenan - I decided the
File::Spec part  could wait till after 5.26.0 ]

dist/Time-HiRes/Makefile.PL

index ca4d4dc..66691fd 100644 (file)
@@ -417,11 +417,11 @@ sub DEFINE {
 }
 
 sub init {
-    my $hints = File::Spec->catfile(".", "hints", "$^O.pl");
+    my $hints = File::Spec->catfile("hints", "$^O.pl");
     if (-f $hints) {
        print "Using hints $hints...\n";
        local $self;
-       do $hints;
+       do "./$hints";
        if (exists $self->{LIBS}) {
            $LIBS = $self->{LIBS};
            print "Extra libraries: @$LIBS...\n";