This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update to ExtUtils::CBuilder 0.280226
File::Basename::fileparse(), when called with two arguments, is
documented to return a list of three elements:
The non-suffix part of the file's basename.
The file's dirname, plus trailing path separator.
The suffix part of the file's basename.
Thus,
my ($name,$path,$suffix) = fileparse('/tmp/perl/p5p/foo.patch', qr/\.[^.]*/);
returns:
$name: foo
$path: /tmp/perl/p5p/
$suffix: .patch
If we want to take those values and compose a path with
File::Spec->catfile(), we have to bear in mind that File::Spec generally
expects to have directories precede filenames in its arguments. Thus,
the correct way to use the values returned by fileparse() would be:
my $cf = File::Spec->catfile($path, $name . $suffix);
In ExtUtils::CBuilder::Base::new(), however, the return values from
fileparse() were named in a way that suggested that the first value
would be the dirname and the second would be the non-suffix part of the
basename:
my ($ccpath, $ccbase, $ccsfx ) = fileparse($self->{config}{cc}, qr/\.[^.]*/);
$ccpath -- which here is really a basename -- was then used as the first
argument to catfile():
File::Spec->catfile( $ccpath, $cxx, $ccsfx )
In addition, in the above $ccsfx should not have been a separate
argument. Rather, it should have been concatenated without a path
separator to the second argument.
For: RT # 131749. See also:
https://github.com/Perl-Toolchain-Gang/ExtUtils-CBuilder/pull/6 (thanks
to stphnlyd of Perl Toolchain Gang).
Signed-off-by: James E Keenan <jkeenan@cpan.org>
17 files changed: