dougm 2002/08/25 20:08:20
Modified: lib/Apache Build.pm
Log:
adjust to ap_release.h version changes. SIGH.
Revision Changes Path
1.105 +17 -4 modperl-2.0/lib/Apache/Build.pm
Index: Build.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -r1.104 -r1.105
--- Build.pm 15 Aug 2002 02:10:32 -0000 1.104
+++ Build.pm 26 Aug 2002 03:08:19 -0000 1.105
@@ -742,10 +742,23 @@
my $version;
- while(<$fh>) {
- next unless /^\#define\s+AP_SERVER_BASEREVISION\s+\"(.*)\"/;
- $version = $1;
- last;
+ while (<$fh>) {
+ #now taking bets on how many friggin times this will change
+ #over the course of apache 2.0. 1.3 changed it at least a half
+ #dozen times. hopefully it'll stay in the same file at least.
+ if (/^\#define\s+AP_SERVER_MAJORVERSION\s+\"(\d+)\"/) {
+ #XXX could be more careful here. whatever. see above.
+ my $major = $1;
+ my $minor = (split /\s+/, scalar(<$fh>))[-1];
+ my $patch = (split /\s+/, scalar(<$fh>))[-1];
+ $version = join '.', $major, $minor, $patch;
+ $version =~ s/\"//g;
+ last;
+ }
+ elseif (/^\#define\s+AP_SERVER_BASEREVISION\s+\"(.*)\"/) {
+ $version = $1;
+ last;
+ }
}
close $fh;