You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Branko Čibej <br...@xbc.nu> on 2002/08/23 21:26:30 UTC

[PATCH] [Win32] Update win32ver.awk for changed contents of ap_release.h

The win32ver.awk script expects that AP_SERVER_BASEREVISION, defined in 
ap_release.h, is the "real" version name. These days, it's composed from 
other defines, which means that win32ver.awk generates incorrect .rc 
files. This patch solves the problem by making it parse the version 
number straight from the components.

--- win32ver.awk.~1.4.~	2002-03-19 14:59:17.000000000 +0100
+++ win32ver.awk	2002-08-23 21:21:30.000000000 +0200
@@ -35,12 +35,19 @@
   }
 
   while ((getline < rel_h) > 0) {
-    if (match ($0, /^#define AP_SERVER_BASEREVISION "[^"]+"/)) {
-      ver = substr($0, RSTART + 32, RLENGTH - 33);
+    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_patch = substr($3, 2, length($3) - 2);
     }
   }
 
-  verc = ver;
+  ver = ver_major "." ver_minor "." ver_patch;
+  verc = ver_major "," ver_minor "," ver_patch;
   gsub(/\./, ",", verc);
   if (build) {
     sub(/-.*/, "", verc)



-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


Re: [PATCH] [Win32] Update win32ver.awk for changed contents of ap_release.h

Posted by Ian Holsman <ia...@apache.org>.
Thanks Branko.

Branko Čibej wrote:
> The win32ver.awk script expects that AP_SERVER_BASEREVISION, defined in 
> ap_release.h, is the "real" version name. These days, it's composed from 
> other defines, which means that win32ver.awk generates incorrect .rc 
> files. This patch solves the problem by making it parse the version 
> number straight from the components.
> 
> --- win32ver.awk.~1.4.~    2002-03-19 14:59:17.000000000 +0100
> +++ win32ver.awk    2002-08-23 21:21:30.000000000 +0200
> @@ -35,12 +35,19 @@
>   }
> 
>   while ((getline < rel_h) > 0) {
> -    if (match ($0, /^#define AP_SERVER_BASEREVISION "[^"]+"/)) {
> -      ver = substr($0, RSTART + 32, RLENGTH - 33);
> +    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_patch = substr($3, 2, length($3) - 2);
>     }
>   }
> 
> -  verc = ver;
> +  ver = ver_major "." ver_minor "." ver_patch;
> +  verc = ver_major "," ver_minor "," ver_patch;
>   gsub(/\./, ",", verc);
>   if (build) {
>     sub(/-.*/, "", verc)
> 
> 
>