Making it somewhat more portable
authorMichael G. Schwern <schwern@pobox.com>
Tue, 18 Dec 2001 00:40:38 +0000 (19:40 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 18 Dec 2001 14:02:49 +0000 (14:02 +0000)
Message-ID: <20011218054038.GB4362@blackrider>

p4raw-id: //depot/perl@13753

lib/ExtUtils/Installed.pm
lib/ExtUtils/t/Installed.t

index a0eeaf4..bb744b0 100644 (file)
@@ -85,7 +85,7 @@ if ($DOSISH)
 
 # Read the core packlist
 $self->{Perl}{packlist} =
-   ExtUtils::Packlist->new("$installarchlib/.packlist");
+   ExtUtils::Packlist->new( File::Spec->catfile($installarchlib, '.packlist') );
 $self->{Perl}{version} = $Config{version};
 
 # Read the module packlists
index f6bd21b..ca3e9af 100644 (file)
@@ -88,13 +88,15 @@ SKIP: {
 
        # avoid warning and death by localizing glob
        local *ExtUtils::Installed::Config;
+    my $fake_mod_dir = File::Spec->catdir(cwd(), 'auto', 'FakeMod');
        %ExtUtils::Installed::Config = (
-               archlib         => cwd(),
-               sitearch        => cwd() . 'auto/FakeMod',
+               archlib            => cwd(),
+        installarchlib => cwd(),
+               sitearch           => $fake_mod_dir,
        );
 
        # necessary to fool new()
-       push @INC, cwd() . '/auto/FakeMod';
+       push @INC, $fake_mod_dir;
 
        my $realei = ExtUtils::Installed->new();
        ok( exists $realei->{FakeMod}, 'new() should find modules with .packlists');
@@ -111,9 +113,9 @@ is( join(' ', $ei->modules()), 'abc def ghi',
 # files
 $ei->{goodmod} = { 
        packlist => { 
-               $Config{installman1dir} . '/foo' => 1,
-               $Config{installman3dir} . '/bar' => 1,
-               $Config{prefix} . '/foobar' => 1,
+               File::Spec->catdir($Config{installman1dir}, 'foo') => 1,
+               File::Spec->catdir($Config{installman3dir}, 'bar') => 1,
+               File::Spec->catdir($Config{prefix}, 'foobar') => 1,
                foobaz  => 1,
        },
 };