Skip to content

Commit 288c097

Browse files
committed
Match final dir component in init_MANPODS
It was matching the end of the full directory spec, but on VMS, "[foo.man1p]" does not match "man1p" at the end. So parse out the final directory component and match that exactly. Also, the name of the Makefile is not necessarily 'Makefile' so use the real name whatever it is in build_man.t
1 parent d7dc732 commit 288c097

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/ExtUtils/MM_Unix.pm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,12 +1506,13 @@ sub init_MANPODS {
15061506
foreach my $num (1,3) {
15071507
my $installdirs = uc $self->{INSTALLDIRS};
15081508
$installdirs = '' if $installdirs eq 'PERL';
1509-
my $mandir = $self->_expand_macros(
1510-
$self->{ "INSTALL${installdirs}MAN${num}DIR" } );
1509+
my @mandirs = File::Spec->splitdir( $self->_expand_macros(
1510+
$self->{ "INSTALL${installdirs}MAN${num}DIR" } ) );
1511+
my $mandir = pop @mandirs;
15111512
my $section = $num;
15121513

15131514
foreach ($num, "${num}p", "${num}pm", qw< l n o C L >, "L$num") {
1514-
if ( $mandir =~ /\b(?:man|cat)$_$/ ) {
1515+
if ( $mandir =~ /^(?:man|cat)$_$/ ) {
15151516
$section = $_;
15161517
last;
15171518
}

t/build_man.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ unlink $README;
216216
INSTALLDIRS => $INSTALLDIRS,
217217
);
218218

219-
my $makefile = slurp('Makefile');
219+
my $makefile = slurp($mm->{MAKEFILE});
220220

221221
like $makefile, qr/\QMAN1SECTION = 1pm\E/xms, "Set MAN1SECTION";
222222
like $makefile, qr/\QMAN3SECTION = 3pm\E/xms, "Set MAN3SECTION";

0 commit comments

Comments
 (0)