David Wheeler wrote:
On Jul 9, 2004, at 2:23 PM, Stas Bekman wrote:

I don't know how M::B does the version checking, but EU::MM does file parsing, searching for the $VERSION line, so the version number must be hardcoded there, unless you do something like:

$VERSION = do { require Apache2; require mod_perl.pm; $mod_perl::VERSION }


Module::Build uses the same approach. I think that the efforts were synchronized here.

This patch adds that functionality to mp2:

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 9 Jul 2004 22:05:56 -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 {


it's a bit wicked that Apache2 requires itself:

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

but it's needed to find the right mod_perl.pm. May be a comment is due.

PAUSE and any tools based on ExtUtils::MakeMaker version parser should be happy:

% perl -Mblib -MExtUtils::MakeMaker -le 'print MM->parse_version(shift)' lib/Apache2.pm
1.9915


--
__________________________________________________________________
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

Reply via email to