]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
AWK script that extracts the version string to be later used in the link of each
authorBradley Nicholes <bnicholes@apache.org>
Wed, 16 Oct 2002 23:48:00 +0000 (23:48 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Wed, 16 Oct 2002 23:48:00 +0000 (23:48 +0000)
NetWare binary

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97249 13f79535-47bb-0310-9956-ffa450edef68

build/nw_ver.awk [new file with mode: 0644]

diff --git a/build/nw_ver.awk b/build/nw_ver.awk
new file mode 100644 (file)
index 0000000..868dd15
--- /dev/null
@@ -0,0 +1,25 @@
+BEGIN {
+
+  # fetch Apache version numbers from input file and writes them to STDOUT
+
+  while ((getline < ARGV[1]) > 0) {
+    if (match ($0, /^#define AP_SERVER_MAJORVERSION "[^"]+"/)) {
+      ver_major = substr($3, 2, length($3) - 2);
+    }
+    else if (match ($0, /^#define AP_SERVER_MINORVERSION "[^"]+"/)) {
+      ver_minor = substr($3, 2, length($3) - 2);
+    }
+    else if (match ($0, /^#define AP_SERVER_PATCHLEVEL/)) {
+      ver_str_patch = substr($3, 2, length($3) - 2);
+      if (match (ver_str_patch, /[0-9][0-9]*/)) {
+         ver_patch = substr(ver_str_patch, RSTART, RLENGTH); 
+      }
+    }
+  }
+  ver = ver_major "," ver_minor "," ver_patch;
+  ver_str = ver_major "." ver_minor "." ver_str_patch;
+
+  print "VERSION = " ver "";
+  print "VERSION_STR = " ver_str "";
+
+}