You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-commits@perl.apache.org by co...@apache.org on 2017/01/06 15:04:11 UTC

svn commit: r1777626 - /perl/Apache-Test/trunk/lib/Apache/Test.pm

Author: covener
Date: Fri Jan  6 15:04:10 2017
New Revision: 1777626

URL: http://svn.apache.org/viewvc?rev=1777626&view=rev
Log:
fix captures & comparisons in need_min_apache_fix()

Modified:
    perl/Apache-Test/trunk/lib/Apache/Test.pm

Modified: perl/Apache-Test/trunk/lib/Apache/Test.pm
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/lib/Apache/Test.pm?rev=1777626&r1=1777625&r2=1777626&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/Test.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/Test.pm Fri Jan  6 15:04:10 2017
@@ -502,29 +502,26 @@ sub need_min_apache_version {
 sub need_min_apache_fix {
     my @wantlevels = @_;
     my $cfg = Apache::Test::config();
-    (my $current) = $cfg->{server}->{version} =~ m:^Apache/(\d)\.(\d+)\.(\d+):;
-    my $current_major = $1;
-    my $current_minor = $2;
-    my $current_micro = $3;
+    (my $current) = $cfg->{server}->{version} =~ m:^Apache/((\d)\.(\d+)\.(\d+)):;
+    my $current_major = $2;
+    my $current_minor = $3;
+    my $current_micro = $4;
 
     foreach(@wantlevels) { 
         if ($_ =~ m/(\d)\.(\d+)\.(\d+)/) { 
-             print "matched";
-        }
-        my $wanted_major = $1;
-        my $wanted_minor = $2;
-        my $wanted_micro = $3;
-        if ($wanted_major eq $current_major && $wanted_minor eq $current_minor) { 
-            if (normalize_vstring($wanted_micro) < normalize_vstring($current_micro)) {
-                push @SkipReasons,
-                     "apache version $_ or higher is required," .
-                         " this is version $current";
-                return 0;
-            }
-            else { 
-                print     "OK, apache version $_ or higher is required," .
-                         " this is version $current\n";
-                return 1;
+            my $wanted_major = $1;
+            my $wanted_minor = $2;
+            my $wanted_micro = $3;
+            if ($wanted_major eq $current_major && $wanted_minor eq $current_minor) { 
+                if ($wanted_micro > $current_micro) {
+                    push @SkipReasons,
+                         "apache version $_ or higher is required," .
+                             " this is version $current";
+                    return 0;
+                }
+                else { 
+                    return 1;
+                }
             }
         }
     }