From: Bradley Nicholes Date: Wed, 16 Oct 2002 23:48:00 +0000 (+0000) Subject: AWK script that extracts the version string to be later used in the link of each X-Git-Tag: 2.0.44~259 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e832cda187a5927eba2f8ea96ef8fb698e5013d5;p=thirdparty%2Fapache%2Fhttpd.git 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 --- 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 ""; + +}