--- Installed.pm.orig 2004-07-20 16:37:50.000000000 +0100 +++ Installed.pm 2004-07-20 17:23:53.000000000 +0100 @@ -77,24 +77,32 @@ } sub new { - my ($class) = @_; + my ($class, @dirs) = @_; $class = ref($class) || $class; my $self = {}; - my $archlib = $Config{archlibexp}; - my $sitearch = $Config{sitearchexp}; + push @dirs, $Config{sitearchexp}, $Config{archlibexp}; # File::Find does not know how to deal with VMS filepaths. - if( $Is_VMS ) { - $archlib = VMS::Filespec::unixify($archlib); - $sitearch = VMS::Filespec::unixify($sitearch); - } - if ($DOSISH) { - $archlib =~ s|\\|/|g; - $sitearch =~ s|\\|/|g; + foreach ( @dirs ) { + if (!m!$Config{archname}/?$!) { + $_ = File::Spec->catfile($_, $Config{archname}); + } + + if( $Is_VMS ) { + $_ = VMS::Filespec::unixify($_); + } + + if ($DOSISH) { + s|\\|/|g; + } + } + my $archlib = @dirs[-1]; + + # Read the core packlist $self->{Perl}{packlist} = ExtUtils::Packlist->new( File::Spec->catfile($archlib, '.packlist') ); @@ -108,11 +116,15 @@ # Hack of the leading bits of the paths & convert to a module name my $module = $File::Find::name; - $module =~ s!\Q$archlib\E/?auto/(.*)/.packlist!$1!s or - $module =~ s!\Q$sitearch\E/?auto/(.*)/.packlist!$1!s; + + foreach my $dir ( @dirs ) { + $module =~ s!\Q$dir\E/?auto/(.*)/.packlist!$1!s and last; + } + my $modfile = "$module.pm"; $module =~ s!/!::!g; + print $module,"\n"; # Find the top-level module file in @INC $self->{$module}{version} = ''; foreach my $dir (@INC) { @@ -131,8 +143,8 @@ ExtUtils::Packlist->new($File::Find::name); }; - my(@dirs) = grep { -e } ($archlib, $sitearch); - find($sub, @dirs) if @dirs; + my(@search_dirs) = grep { -e } (@dirs); + find($sub, @search_dirs) if @search_dirs; return(bless($self, $class)); }