Subject: | [PATCH] Fix parent directory in pod2usage auxiliary script. |
File::Basename::dirname does not always remove the last component of the path if that component is already a directory, depending on platform. This behavior is documented. pod2usage.t has been failing on VMS because we get the wrong directory into @INC.
So, since we already have File::Spec loaded, just use the more obvious and portable method for getting the parent directory. The patch is against blead so apply with patch -p2.
Side note. Most of the uses of catfile in this module's tests should really be catdir. If you want the result to be a valid directory spec, use catdir, not catfile. We seem to be getting away with it for entries in @INC, but in other contexts that mix-up will fail.
Subject: | testp2pt.patch |
--- cpan/Pod-Usage/t/pod/testp2pt.pl;-0 2017-10-18 05:29:59 -0500
+++ cpan/Pod-Usage/t/pod/testp2pt.pl 2019-08-30 08:52:25 -0500
@@ -11,7 +11,7 @@ BEGIN {
unshift @INC, $THISDIR;
require "testcmp.pl";
import TestCompare;
- $PARENTDIR = dirname $THISDIR;
+ $PARENTDIR = File::Spec->catdir($THISDIR, File::Spec->updir());
push @INC, map { File::Spec->catfile($_, 'lib') } ($PARENTDIR, $THISDIR);
}