~ubuntu-branches/ubuntu/natty/ntop/natty

« back to all changes in this revision

Viewing changes to utils/showoses.awk

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2005-01-30 21:59:13 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050130215913-xc3ke963bw49b3k4
Tags: 2:3.0-5
* Updated README.Debian file so users will understand what to do at
  install, closes: #291794, #287802.
* Updated ntop init script to give better output.
* Also changed log directory from /var/lib/ntop to /var/log/ntop,
  closes: #252352.
* Quoted the interface list to allow whitespace, closes: #267248.
* Added a couple of logcheck ignores, closes: #269321, #269319.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
BEGIN {
 
2
    echo="off"
 
3
    finished="no"
 
4
    terms="off"
 
5
    blank = 0
 
6
}
 
7
 
 
8
finished == "yes" {
 
9
    next
 
10
}
 
11
 
 
12
/^AC_INIT/ {
 
13
    gsub(/[\[\],]/, " ")
 
14
    printf("%s OS Support status extract for version %s\n    Run %s\n\n", $2, $3, strftime())
 
15
    printf("%-20s %10s %-10s %-15s\n", "config.guess value", "compiler", "OS name", "Status")
 
16
    printf("%-20s %10s %-10s %-15s\n", "------------------", "---------", "---------", "---------------")
 
17
}
 
18
 
 
19
/^ *\*\-\*\-/ {
 
20
    i=index($1, ":")
 
21
    if (i > 0) {
 
22
        compiler=substr($1, i+1)
 
23
        if (length(compiler) > 1) {
 
24
            sub(/\*$/, "", compiler)
 
25
        }
 
26
        $1=substr($1, 1, i-1)
 
27
    } else {
 
28
        compiler="*"
 
29
    }
 
30
    flag=substr($1, 5)
 
31
    gsub(/\[\[/, "[", flag)
 
32
    gsub(/\]\]/, "]", flag)
 
33
    next
 
34
}
 
35
 
 
36
/STATUS="UNKNOWN"/ { 
 
37
    next
 
38
}
 
39
 
 
40
/DEFINEOS=/ {
 
41
    gsub(/[";]/, "")
 
42
    i=index($1, "=")
 
43
    OS=substr($1, i+1)
 
44
    i=index($2, "=")
 
45
    STATUS=substr($2, i+1)
 
46
 
 
47
    if (STATUS == "SUPPORTED") {
 
48
        printf("%-20s %10s %-10s %-15s\n", flag, compiler, OS, STATUS)
 
49
    } else if (STATUS == "") {
 
50
        printf("%-20s %10s %-10s\n", flag, compiler, OS)
 
51
    } else {
 
52
        printf("%-20s %10s %-10s %15s\n", flag, compiler, OS, STATUS)
 
53
    }
 
54
    next
 
55
}
 
56
 
 
57
 
 
58
/dnl> showoses TERMS/ {
 
59
    terms="on"
 
60
    next
 
61
}
 
62
 
 
63
terms == "off" {
 
64
    next
 
65
}
 
66
 
 
67
/dnl> showoses END/ {
 
68
    finished="yes"
 
69
    terms="off"
 
70
    next
 
71
}
 
72
 
 
73
/^ *[A-Z ]*)/ {
 
74
    tag=$1
 
75
    sub(/)/, "", tag)
 
76
    echo="on"
 
77
    print ""
 
78
    print "Status of '" tag "' means you are:"
 
79
    print ""
 
80
    blank = 0
 
81
    next
 
82
}
 
83
 
 
84
/^ *fi$/ {
 
85
    echo="on"
 
86
    next
 
87
}
 
88
 
 
89
/^ *if / {
 
90
    echo="off"
 
91
    next
 
92
}
 
93
 
 
94
/;;/ {
 
95
    echo="off"
 
96
    next
 
97
}
 
98
 
 
99
echo == "off" {
 
100
    next
 
101
}
 
102
 
 
103
/\$/ {
 
104
    next
 
105
}
 
106
 
 
107
/\*\*\*/ {
 
108
    next
 
109
}
 
110
 
 
111
$1 == "echo" {
 
112
    gsub(/["\*]/, "")
 
113
    gsub(/NOTE:/, "")
 
114
    gsub(/ERROR:/, "")
 
115
    $1=""
 
116
    gsub(/ *$/, "")
 
117
    if (length($0) == 0) {
 
118
        if (++blank == 1) {
 
119
            print ""
 
120
        }
 
121
        next
 
122
    } else {
 
123
        blank = 0
 
124
    }
 
125
    print "    " $0
 
126
}
 
127
 
 
128
END {
 
129
    print ""
 
130
    print "Status of blank means that the support level depends"
 
131
    print "upon ntop settings and/or other factors."
 
132
    print ""
 
133
    print ""
 
134
    print "--enable-showoses complete, remainder of ./configure tasks"
 
135
    print "are NOT done.  Rerun without --enable-showoses for that."
 
136
    print ""
 
137
}