~ubuntu-branches/ubuntu/oneiric/libapache-mod-jk/oneiric

« back to all changes in this revision

Viewing changes to common/build/get_ver.awk

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2006-08-05 16:30:53 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060805163053-myf66gm6j1a21ps6
Tags: 1:1.2.18-1ubuntu1
Merge from Debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
BEGIN {
2
 
 
3
 
  # fetch mod_jk version numbers from input file and writes them to STDOUT
4
 
 
5
 
  while ((getline < ARGV[1]) > 0) {
6
 
    if (match ($0, /^#define JK_VERMAJOR [^"]+/)) {
7
 
      jk_ver_major = substr($3, 1, length($3));
8
 
    }
9
 
    else if (match ($0, /^#define JK_VERMINOR [^"]+/)) {
10
 
      jk_ver_minor = substr($3, 1, length($3));
11
 
    }
12
 
    else if (match ($0, /^#define JK_VERFIX [^"]+/)) {
13
 
      jk_ver_fix = substr($3, 1, length($3));
14
 
    }
15
 
    else if (match ($0, /^#define JK_VERISRELEASE [^"]+/)) {
16
 
      jk_ver_isrelease = substr($3, 1, length($3));
17
 
    }
18
 
    else if (match ($0, /^#define JK_VERBETA [^"]+/)) {
19
 
      jk_ver_isbeta = substr($3, 1, length($3));
20
 
    }
21
 
    else if (match ($0, /^#define JK_BETASTRING [^"]+/)) {
22
 
      jk_ver_betastr = substr($3, 2, length($3) - 2);
23
 
    }
24
 
  }
25
 
  jk_ver = jk_ver_major "," jk_ver_minor "," jk_ver_fix;
26
 
  jk_ver_str = jk_ver_major "." jk_ver_minor "." jk_ver_fix;
27
 
  if (jk_ver_isrelease != 1) {
28
 
    jk_ver_str = jk_ver_str "-dev";
29
 
  }
30
 
  if (jk_ver_isbeta == 1) {
31
 
    jk_ver_str = jk_ver_str "-beta-" jk_ver_betastr;
32
 
  }
33
 
  
34
 
  # fetch Apache version numbers from input file and writes them to STDOUT
35
 
 
36
 
  if (ARGV[2]) {
37
 
    if (match (ARGV[2], /ap_release.h/)) {
38
 
      while ((getline < ARGV[2]) > 0) {
39
 
        if (match ($0, /^#define AP_SERVER_MAJORVERSION "[^"]+"/)) {
40
 
          ap_ver_major = substr($3, 2, length($3) - 2);
41
 
        }
42
 
        else if (match ($0, /^#define AP_SERVER_MINORVERSION "[^"]+"/)) {
43
 
          ap_ver_minor = substr($3, 2, length($3) - 2);
44
 
        }
45
 
        else if (match ($0, /^#define AP_SERVER_PATCHLEVEL/)) {
46
 
          ap_ver_str_patch = substr($3, 2, length($3) - 2);
47
 
          if (match (ap_ver_str_patch, /[0-9][0-9]*/)) {
48
 
            ap_ver_patch = substr(ap_ver_str_patch, RSTART, RLENGTH); 
49
 
          }
50
 
        }
51
 
      }
52
 
      ap_ver_str = ap_ver_major "." ap_ver_minor "." ap_ver_str_patch;
53
 
    }
54
 
    if (match (ARGV[2], /httpd.h/)) {
55
 
      while ((getline < ARGV[2]) > 0) {
56
 
        if (match ($0, /^#define SERVER_BASEREVISION "[^"]+"/)) {
57
 
          ap_ver_str = substr($3, 2, length($3) - 2);
58
 
        }
59
 
      }
60
 
    }
61
 
    print "AP_VERSION_STR = " ap_ver_str "";
62
 
  }
63
 
 
64
 
  print "JK_VERSION = " jk_ver "";
65
 
  print "JK_VERSION_STR = " jk_ver_str "";
66
 
 
67
 
}