David Wheeler wrote:
On Tuesday, May 13, 2003, at 08:08  PM, Stas Bekman wrote:

If an old mod_perl 1.0 is installed and it overrides Apache::Test, Makefile.PL will simply fail to satisfy the requirement of a specific version (because Apache::test's version is smaller than Apache::Test's).


Not sure I follow you here. CPAN.pm checks for such dependencies, but Makefile.PL, AFAIK, does not. And CPANPLUS doesn't work right, FWIW, because Apache::test has no version number at all, which CPANPLUS (mistakenly) assumes means that it's up to date.

so that bug should be fixed in CPANPLUS, in any case new Apache/test will have a $VERSION

However taking again this track of overriding test.pm, we may still have a problem in the following situation:

root installs mod_perl 1.27 system-wide, user installs Apache::Test locally (can't unlink Apache/test.pm), this can be a problem if user's @INC are added after the system-wide ones. But that would be silly, isn't it?


Most likely, yes.

If we are sticking with this track, we need to figure out the way to make sure that Apache/test.pm is nuked. David, if Apache-Test includes Apache/test.pm and Apache/Test.pm is it ensured that any other occurance of Apache/test.pm will be nuked?


I think only if UNINST=1.

So we probably should check whether UNINST=1 is on, and if not (and if we find another test.pm in @INC) die telling users to set it on.

I've attached something that might work (apply against the current mod_perl 2.0 cvs). I've moved the real Apache::Test and Apache::test into different files. And replaced them with:

Apache-Test/lib/Apache/test.pm
---------------------
# this is a workaround for a collision we have on the case-insensitive
# platforms which may have Apache/test.pm from mod_perl 1.0
# installed.

require Apache::TestReal;

# this is a workaround for ExtUtils::MakeMaker::parse_version
$VERSION = do { require Apache::test_mp1; $Apache::test::VERSION };

1;
---------------------

and:

Apache-Test/lib/Apache/test.pm
---------------------
# this is a workaround for a collision we have on the case-insensitive
# platforms which may have Apache/test.pm from mod_perl 1.0
# installed.

require Apache::test_mp1;

# this is a workaround for ExtUtils::MakeMaker::parse_version
$VERSION = do { require Apache::TestReal; $Apache::Test::VERSION; };

1;
---------------------

these two wrappers (the are a part of the attached patch) will live together in Apache-Test, on case-sensitive systems they will both installed and will do the right thing. On case-insensitive only one will win, but nevertheless it'll work regardless of 'require Apache::Test' or 'require Apache::test', since any file will load both package.

I also had to add a workaround for $VERSION settings. So

perl -MExtUtils::MakeMaker -le 'print MM->parse_version(shift)' Apache/test.pm
perl -MExtUtils::MakeMaker -le 'print MM->parse_version(shift)' Apache/Test.pm

will do the right thing.

See if you can spot some problems with that solution. And also give it a try.

For mod_perl 1.0, we are simply going to nuke Apache/test.pm from there and replace it with full Apache-Test cvs repository, so we need to apply any changes to Apache/test_mp1.pm it'll be only under one source control.

Let me know what do you think.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Attachment: patch
Description: application/java-vm



Reply via email to