diff options
author | Salvatore Bonaccorso <carnil@debian.org> | 2020-05-15 21:43:28 +0200 |
---|---|---|
committer | Salvatore Bonaccorso <carnil@debian.org> | 2020-05-15 21:43:28 +0200 |
commit | a9d620f12037ecc62bc18915e2eb7e5b81c43afb (patch) | |
tree | fa8020b0b261d879cb76d3ae7f4104be79e23689 /inc/Module/Install.pm | |
parent | b528cc9c9bb8a277708ef8f5420c89baa437f067 (diff) |
New upstream version 1.00
Diffstat (limited to 'inc/Module/Install.pm')
-rw-r--r-- | inc/Module/Install.pm | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm index ff767fa..7ba98c2 100644 --- a/inc/Module/Install.pm +++ b/inc/Module/Install.pm @@ -31,7 +31,7 @@ BEGIN { # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. - $VERSION = '1.14'; + $VERSION = '1.19'; # Storage for the pseudo-singleton $MAIN = undef; @@ -244,6 +244,8 @@ sub new { } return $args{_self} if $args{_self}; + $base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS'; + $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); @@ -322,7 +324,7 @@ sub find_extensions { my ($self, $path) = @_; my @found; - File::Find::find( sub { + File::Find::find( {no_chdir => 1, wanted => sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; @@ -336,7 +338,7 @@ sub find_extensions { # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { - my $content = Module::Install::_read($subpath . '.pm'); + my $content = Module::Install::_read($File::Find::name); my $in_pod = 0; foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; @@ -351,7 +353,7 @@ sub find_extensions { } push @found, [ $file, $pkg ]; - }, $path ) if -d $path; + }}, $path ) if -d $path; @found; } @@ -373,8 +375,6 @@ sub _caller { return $call; } -# Done in evals to avoid confusing Perl::MinimumVersion -eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; @@ -383,16 +383,6 @@ sub _read { close FH or die "close($_[0]): $!"; return $string; } -END_NEW -sub _read { - local *FH; - open( FH, "< $_[0]" ) or die "open($_[0]): $!"; - binmode FH; - my $string = do { local $/; <FH> }; - close FH or die "close($_[0]): $!"; - return $string; -} -END_OLD sub _readperl { my $string = Module::Install::_read($_[0]); @@ -413,8 +403,6 @@ sub _readpod { return $string; } -# Done in evals to avoid confusing Perl::MinimumVersion -eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; @@ -424,17 +412,6 @@ sub _write { } close FH or die "close($_[0]): $!"; } -END_NEW -sub _write { - local *FH; - open( FH, "> $_[0]" ) or die "open($_[0]): $!"; - binmode FH; - foreach ( 1 .. $#_ ) { - print FH $_[$_] or die "print($_[0]): $!"; - } - close FH or die "close($_[0]): $!"; -} -END_OLD # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). |