nw_ver.awk revision 945985061b2c440f15b81d495f79b51f696913c2
842ae4bd224140319ae7feec1872b93dfd491143fielding# Licensed to the Apache Software Foundation (ASF) under one or more
842ae4bd224140319ae7feec1872b93dfd491143fielding# contributor license agreements. See the NOTICE file distributed with
842ae4bd224140319ae7feec1872b93dfd491143fielding# this work for additional information regarding copyright ownership.
842ae4bd224140319ae7feec1872b93dfd491143fielding# The ASF licenses this file to You under the Apache License, Version 2.0
842ae4bd224140319ae7feec1872b93dfd491143fielding# (the "License"); you may not use this file except in compliance with
842ae4bd224140319ae7feec1872b93dfd491143fielding# the License. You may obtain a copy of the License at
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# http://www.apache.org/licenses/LICENSE-2.0
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# Unless required by applicable law or agreed to in writing, software
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# distributed under the License is distributed on an "AS IS" BASIS,
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# See the License for the specific language governing permissions and
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# limitations under the License.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingBEGIN {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding # fetch Apache version numbers from input file and writes them to STDOUT
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding while ((getline < ARGV[1]) > 0) {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if (match ($0, /^#define AP_SERVER_COPYRIGHT \\/)) {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if (((getline < ARGV[1]) > 0) && (split($0, c, "\"") == 3)) {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding copyright_str = c[2];
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
dc80439e9fba60c753cd145cb6799409ffea9b71ronald }
dc80439e9fba60c753cd145cb6799409ffea9b71ronald else if (match ($0, /^#define AP_SERVER_MAJORVERSION_NUMBER /)) {
dc80439e9fba60c753cd145cb6799409ffea9b71ronald ver_major = $3;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding else if (match ($0, /^#define AP_SERVER_MINORVERSION_NUMBER /)) {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding ver_minor = $3;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding else if (match ($0, /^#define AP_SERVER_PATCHLEVEL_NUMBER/)) {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding ver_patch = $3;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding else if (match ($0, /^#define AP_SERVER_DEVBUILD_BOOLEAN/)) {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding ver_devbuild = $3;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding ver_nlm = ver_major "," ver_minor "," ver_patch;
dc80439e9fba60c753cd145cb6799409ffea9b71ronald ver_str = ver_major "." ver_minor "." ver_patch (ver_devbuild ? "-dev" : "");
dc80439e9fba60c753cd145cb6799409ffea9b71ronald
dc80439e9fba60c753cd145cb6799409ffea9b71ronald print "VERSION = " ver_nlm "";
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding print "VERSION_STR = " ver_str "";
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding print "COPYRIGHT_STR = " copyright_str "";
dc80439e9fba60c753cd145cb6799409ffea9b71ronald
dc80439e9fba60c753cd145cb6799409ffea9b71ronald}
dc80439e9fba60c753cd145cb6799409ffea9b71ronald
dc80439e9fba60c753cd145cb6799409ffea9b71ronald
dc80439e9fba60c753cd145cb6799409ffea9b71ronald