From e832cda187a5927eba2f8ea96ef8fb698e5013d5 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 16 Oct 2002 23:48:00 +0000 Subject: [PATCH] AWK script that extracts the version string to be later used in the link of each NetWare binary git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97249 13f79535-47bb-0310-9956-ffa450edef68 --- build/nw_ver.awk | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 build/nw_ver.awk diff --git a/build/nw_ver.awk b/build/nw_ver.awk new file mode 100644 index 00000000000..868dd1520b0 --- /dev/null +++ b/build/nw_ver.awk @@ -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 ""; + +} -- 2.47.2