You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by "Philippe M. Chiasson" <go...@ectoplasm.org> on 2004/07/13 01:35:08 UTC

Re: [mp2 patch] $Apache2::VERSION


Stas Bekman wrote:
> In case you may have missed this patch on the users list, here it is 
> again. It ties $Apache2::VERSION to $mod_perl::VERSION so one can 
> require Apache2 for mp2. If it goes in mp1 should also be patched to do 
> the same.

It's funny, I just peeked at Apache.pm in mp1, and it seems to specify
it's own version at 1.27 while mod_perl.pm is at 1.28 ;-)

our $VERSION = do { require mod_perl; $mod_perl::VERSION };

would also do the trick for mod_perl 1.x

> I still want to have PAUSE support multi-generations, but this seems 
> like a cheap workaround for the current dependency problem.
> 
> Index: lib/Apache/Build.pm
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
> retrieving revision 1.164
> diff -u -r1.164 Build.pm
> --- lib/Apache/Build.pm	4 Jul 2004 18:44:49 -0000	1.164
> +++ lib/Apache/Build.pm	12 Jul 2004 23:25:44 -0000
> @@ -1752,7 +1752,12 @@
>   sub generate_apache2_pm {
>       my $self = shift;
> 
> -    my $fixup = !$self->{MP_INST_APACHE2}
> +    my $fixup = << 'EOF';
> +our $VERSION = do { require Apache2; require mod_perl; 
> $mod_perl::VERSION };
> +
> +EOF
> +
> +    $fixup .= !$self->{MP_INST_APACHE2}
>           ? '# MP_INST_APACHE2=0, do nothing'
>           : <<'EOF';
>   BEGIN {
> 

-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Re: [mp2 patch] $Apache2::VERSION

Posted by David Wheeler <da...@kineticode.com>.
On Jul 12, 2004, at 5:32 PM, Stas Bekman wrote:

> Depends on what's your goal. What if you have both installed? You will 
> never get 1.

That might be preferable. ;-)

> This patch introduces nothing that you can't easily do without it. The 
> only purpose is to workaround CPAN/PAUSE limitations.
>
> moreover at the moment mp1's Apache is invalid, and for mp2 anything 
> before the next version won't have $Apache2::VERSION at all. So it's 
> probably only after 2.0 is released and we completely deprecated 
> 1.99_xx, you will be able to rely on that. Therefore it's better to 
> continue documenting that one should check $mod_perl::VERSION.

Okay.

> 99% of the user docs are FAQ. so if you call those docs or FAQ it's 
> exactly the same thing.

Heh, okay.

David


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2 patch] $Apache2::VERSION

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Jul 12, 2004, at 5:12 PM, Stas Bekman wrote:
> 
>> It does so only for mod_perl itself. It doesn't solve it for CPAN 
>> modules.
> 
> 
> Yes, but it allows them to solve it themselves:
> 
> use constant => MODPERL = eval { require Apache2 } ? 2 : eval { require 
> Apache } ? 1 : die $@;
> 
> Right?

Depends on what's your goal. What if you have both installed? You will 
never get 1.

This patch introduces nothing that you can't easily do without it. The 
only purpose is to workaround CPAN/PAUSE limitations.

moreover at the moment mp1's Apache is invalid, and for mp2 anything 
before the next version won't have $Apache2::VERSION at all. So it's 
probably only after 2.0 is released and we completely deprecated 
1.99_xx, you will be able to rely on that. Therefore it's better to 
continue documenting that one should check $mod_perl::VERSION.

>> The only drawback I can see is a new potential for confusion: "which 
>> module should I require, mod_perl or Apache2", which of course will be 
>> documented, but who reads docs nowadays...
> 
> 
> Not me! ;-)
> 
> Seriously, I think that the gradually improving docs will help. And this 
> sort of thing should definitely go into the FAQ.

99% of the user docs are FAQ. so if you call those docs or FAQ it's 
exactly the same thing.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2 patch] $Apache2::VERSION

Posted by David Wheeler <da...@kineticode.com>.
On Jul 12, 2004, at 5:12 PM, Stas Bekman wrote:

> It does so only for mod_perl itself. It doesn't solve it for CPAN 
> modules.

Yes, but it allows them to solve it themselves:

use constant => MODPERL = eval { require Apache2 } ? 2 : eval { require 
Apache } ? 1 : die $@;

Right?

> The only drawback I can see is a new potential for confusion: "which 
> module should I require, mod_perl or Apache2", which of course will be 
> documented, but who reads docs nowadays...

Not me! ;-)

Seriously, I think that the gradually improving docs will help. And 
this sort of thing should definitely go into the FAQ.

Regards,

David

-- 
David Wheeler
President, Kineticode, Inc.
http://www.kineticode.com/
Kineticode. Setting knowledge in motion.[sm]


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2 patch] $Apache2::VERSION

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Jul 12, 2004, at 4:42 PM, Stas Bekman wrote:
> 
>>>>> In case you may have missed this patch on the users list, here it 
>>>>> is again. It ties $Apache2::VERSION to $mod_perl::VERSION so one 
>>>>> can require Apache2 for mp2. If it goes in mp1 should also be 
>>>>> patched to do the same.
>>
>>
>> But let's wait a bit so others can chime in if they are against the 
>> change.
> 
> 
> If this really solves the version problem (and it seems like it does), 
> then I say, +1!

It does so only for mod_perl itself. It doesn't solve it for CPAN modules.

The only drawback I can see is a new potential for confusion: "which 
module should I require, mod_perl or Apache2", which of course will be 
documented, but who reads docs nowadays...

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2 patch] $Apache2::VERSION

Posted by David Wheeler <da...@kineticode.com>.
On Jul 12, 2004, at 4:42 PM, Stas Bekman wrote:

>>>> In case you may have missed this patch on the users list, here it 
>>>> is again. It ties $Apache2::VERSION to $mod_perl::VERSION so one 
>>>> can require Apache2 for mp2. If it goes in mp1 should also be 
>>>> patched to do the same.
>
> But let's wait a bit so others can chime in if they are against the 
> change.

If this really solves the version problem (and it seems like it does), 
then I say, +1!

Regards,

David


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2 patch] $Apache2::VERSION

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 12 Jul 2004, Stas Bekman wrote:

> Stas Bekman wrote:
> > Philippe M. Chiasson wrote:
> >> Stas Bekman wrote:
> >>
> >>> In case you may have missed this patch on the users list, here it is
> >>> again. It ties $Apache2::VERSION to $mod_perl::VERSION so one can
> >>> require Apache2 for mp2. If it goes in mp1 should also be patched to
> >>> do the same.
> >>
> >> It's funny, I just peeked at Apache.pm in mp1, and it seems to specify
> >> it's own version at 1.27 while mod_perl.pm is at 1.28 ;-)
> >>
> >> our $VERSION = do { require mod_perl; $mod_perl::VERSION };
> >>
> >> would also do the trick for mod_perl 1.x
> >
> > Let's commit those in unison then :)
>
> But let's wait a bit so others can chime in if they are
> against the change.

+1 (for the changes)

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2 patch] $Apache2::VERSION

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.

Stas Bekman wrote:
> Stas Bekman wrote:
> 
>>Philippe M. Chiasson wrote:
>>
>>
>>>
>>>Stas Bekman wrote:
>>>
>>>
>>>>In case you may have missed this patch on the users list, here it is 
>>>>again. It ties $Apache2::VERSION to $mod_perl::VERSION so one can 
>>>>require Apache2 for mp2. If it goes in mp1 should also be patched to 
>>>>do the same.
>>>
>>>
>>>
>>>It's funny, I just peeked at Apache.pm in mp1, and it seems to specify
>>>it's own version at 1.27 while mod_perl.pm is at 1.28 ;-)
>>>
>>>our $VERSION = do { require mod_perl; $mod_perl::VERSION };
>>>
>>>would also do the trick for mod_perl 1.x
>>
>>
>>Let's commit those in unison then :)
> 
> 
> But let's wait a bit so others can chime in if they are against the change.

That's what I figured ;-)


-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Re: [mp2 patch] $Apache2::VERSION

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Philippe M. Chiasson wrote:
> 
>>
>>
>> Stas Bekman wrote:
>>
>>> In case you may have missed this patch on the users list, here it is 
>>> again. It ties $Apache2::VERSION to $mod_perl::VERSION so one can 
>>> require Apache2 for mp2. If it goes in mp1 should also be patched to 
>>> do the same.
>>
>>
>>
>> It's funny, I just peeked at Apache.pm in mp1, and it seems to specify
>> it's own version at 1.27 while mod_perl.pm is at 1.28 ;-)
>>
>> our $VERSION = do { require mod_perl; $mod_perl::VERSION };
>>
>> would also do the trick for mod_perl 1.x
> 
> 
> Let's commit those in unison then :)

But let's wait a bit so others can chime in if they are against the change.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2 patch] $Apache2::VERSION

Posted by Stas Bekman <st...@stason.org>.
Philippe M. Chiasson wrote:
> 
> 
> Stas Bekman wrote:
> 
>> In case you may have missed this patch on the users list, here it is 
>> again. It ties $Apache2::VERSION to $mod_perl::VERSION so one can 
>> require Apache2 for mp2. If it goes in mp1 should also be patched to 
>> do the same.
> 
> 
> It's funny, I just peeked at Apache.pm in mp1, and it seems to specify
> it's own version at 1.27 while mod_perl.pm is at 1.28 ;-)
> 
> our $VERSION = do { require mod_perl; $mod_perl::VERSION };
> 
> would also do the trick for mod_perl 1.x

Let's commit those in unison then :)

But 'our' can't be used in mp1. You must use: use vars qw($VERSION) instead.

>> I still want to have PAUSE support multi-generations, but this seems 
>> like a cheap workaround for the current dependency problem.
>>
>> Index: lib/Apache/Build.pm
>> ===================================================================
>> RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
>> retrieving revision 1.164
>> diff -u -r1.164 Build.pm
>> --- lib/Apache/Build.pm    4 Jul 2004 18:44:49 -0000    1.164
>> +++ lib/Apache/Build.pm    12 Jul 2004 23:25:44 -0000
>> @@ -1752,7 +1752,12 @@
>>   sub generate_apache2_pm {
>>       my $self = shift;
>>
>> -    my $fixup = !$self->{MP_INST_APACHE2}
>> +    my $fixup = << 'EOF';
>> +our $VERSION = do { require Apache2; require mod_perl; 
>> $mod_perl::VERSION };
>> +
>> +EOF
>> +
>> +    $fixup .= !$self->{MP_INST_APACHE2}
>>           ? '# MP_INST_APACHE2=0, do nothing'
>>           : <<'EOF';
>>   BEGIN {
>>
> 


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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org