apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
Subject svn commit: r563835 - /apr/apr/trunk/build/nw_ver.awk
Date Wed, 08 Aug 2007 12:36:08 GMT
Author: fuankg
Date: Wed Aug  8 05:36:07 2007
New Revision: 563835

URL: http://svn.apache.org/viewvc?view=rev&rev=563835
Log:
fixed version string for dev builds;
added check for wanted version.

Modified:
    apr/apr/trunk/build/nw_ver.awk

Modified: apr/apr/trunk/build/nw_ver.awk
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/nw_ver.awk?view=diff&rev=563835&r1=563834&r2=563835
==============================================================================
--- apr/apr/trunk/build/nw_ver.awk (original)
+++ apr/apr/trunk/build/nw_ver.awk Wed Aug  8 05:36:07 2007
@@ -10,16 +10,31 @@
       ver_minor = $3;
     }
     else if (match ($0, /^#define APR_PATCH_VERSION/)) {
-      ver_str_patch = $3;
-      if (match (ver_str_patch, /[0-9][0-9]*/)) {
-         ver_patch = substr(ver_str_patch, RSTART, RLENGTH); 
-      }
+      ver_patch = $3;
+    }
+    else if (match ($0, /^#define APR_IS_DEV_VERSION/)) {
+      ver_devbuild = 1;
     }
   }
-  ver = ver_major "," ver_minor "," ver_patch;
-  ver_str = ver_major "." ver_minor "." ver_str_patch;
-
-  print "VERSION = " ver "";
-  print "VERSION_STR = " ver_str "";
+  ver_str = ver_major "." ver_minor "." ver_patch (ver_devbuild ? "-dev" : "");
+  if (WANTED) {
+    ver_num = ver_major * 1000000 + ver_minor * 1000 + ver_patch;
+    if (ver_num < WANTED) {
+      print "ERROR: APR version " ver_str " does NOT match!";
+      exit 1;
+    } else if (ver_num > (WANTED + 1000)) {
+      print "WARNING: APR version " ver_str " higher than expected!";
+      exit 0;
+    } else {
+      print "OK: APR version " ver_str "";
+      exit 0;
+    }
+  } else {
+    ver_nlm = ver_major "," ver_minor "," ver_patch;
+    print "VERSION = " ver_nlm "";
+    print "VERSION_STR = " ver_str "";
+  }
 
 }
+
+



Mime
View raw message