File: 350-ap-test-apache24-define.patch

package info (click to toggle)
libapache2-mod-perl2 2.0.9~1624218-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 11,840 kB
  • sloc: perl: 95,064; ansic: 14,522; makefile: 49; sh: 18
file content (41 lines) | stat: -rw-r--r-- 942 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Description: add a conditional define for Apache 2.4 (-D APACHE24)
Origin: CPAN RT
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=87620
Author: Michael Schout
Reviewed-by: Ivan Kohler <ivan@freeside.biz>
Last-Update: 2014-06-27

--- a/Apache-Test/lib/Apache/TestServer.pm
+++ b/Apache-Test/lib/Apache/TestServer.pm
@@ -85,6 +85,15 @@ sub post_config {
         $self->{rev} = 0; # unknown
     }
 
+    ($self->{revminor}) = $self->{version} =~ m|/\d\.(\d)|;
+
+    if ($self->{revminor}) {
+        debug "Matched Apache revminor $self->{version} $self->{revminor}";
+    }
+    else {
+        $self->{revminor} = 0;
+    }
+
     $self;
 }
 
@@ -126,7 +135,14 @@ sub pid_file {
 
 sub dversion {
     my $self = shift;
-    "-D APACHE$self->{rev}";
+
+    my $dv = "-D APACHE$self->{rev}";
+
+    if ($self->{rev} == 2 and $self->{revminor} >= 4) {
+        $dv .= " -D APACHE24";
+    }
+
+    return $dv;
 }
 
 sub config_defines {