iff -u -r1.92.2.6 spamassassin.raw --- spamassassin.raw 19 May 2003 00:20:20 -0000 1.92.2.6 +++ spamassassin.raw 29 Jul 2003 19:38:09 -0000 @@ -15,22 +15,27 @@ # warnings and causes more trouble than its worth. We don't need to be too # smart about this BTW. my @bin = File::Spec->splitpath($0); - my $bin = ($bin[0] ? File::Spec->catpath(@bin[0..1]) : $bin[1]) # /home/jm/foo -> /home/jm + my $bin = ($bin[0] ? File::Spec->catpath(@bin[0..1],'') : $bin[1]) # /home/jm/foo -> /home/jm || File::Spec->curdir; # foo -> . + $bin =~ s?/$??; # for test with File::Spec->updir below + + my @installsitelib = File::Spec->splitpath('@@INSTALLSITELIB@@'); # check to make sure it wasn't just installed in the normal way. # note that ./lib/Mail/SpamAssassin.pm takes precedence, for # building SpamAssassin on a machine where an old version is installed. - if (-e $bin.'/lib/Mail/SpamAssassin.pm' - || !-e '@@INSTALLSITELIB@@/Mail/SpamAssassin.pm') + if (-e File::Spec->catfile($bin, split('/', 'lib/Mail/SpamAssassin.pm') ) + || !-e File::Spec->catfile( @installsitelib, split('/','Mail/SpamAssassin.pm')) ) { # Firstly, are we running "make test" in the "t" dir? the test files # *need* to use 'blib', so that 'use bytes' is removed for pre-5.6 perls # beforehand by the preproc. However, ./spamassassin does not, as the # preproc will have stripped out the "use rule files from cwd" code from # Mail::SpamAssassin. So we want to use blib just for the t scripts. - if ( $bin eq '../' && -e '../blib/lib/Mail/SpamAssassin.pm' ) { - unshift(@INC, '../blib/lib'); + if ( $bin eq File::Spec->updir && + -e File::Spec->catfile(File::Spec->updir, + split('/','blib/lib/Mail/SpamAssassin.pm')) ) { + unshift(@INC, File::Spec->catdir(File::Spec->updir, 'blib', 'lib') ); } else { # These are common paths where the SA libs might be found.