-
Notifications
You must be signed in to change notification settings - Fork 73
/
install_lib
110 lines (105 loc) · 2.47 KB
/
install_lib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Holds common install function used e.g. by install.sh and omd_install.sh
cmp() {
if [ "$(uname)" = "Darwin" ]; then
SED=gsed
else
SED=sed
fi
cat $1 | $SED 's#\(var\)\s*\(\S*\)\s*=\s*#\1 \2=#;s#^\s*##;s#\s*$##;s#\t+# #g' | awk '
BEGIN { OK=1; braces=0 }
{
# Remove /* */ one line comments
sub(/\/\*[^@]*\*\//,"");
# Remove // comments (line beginning)
sub(/^\/\/.*/,"");
# Count braces
anz1 = gsub(/\{/,"{");
anz2 = gsub(/}/,"}");
if (OK == 1) {
braces += anz1;
braces -= anz2;
}
}
/\/\*/ {
c = gsub(/\/\*[^@]*$/,"");
if(c > 0) {
OK=0;
}
}
/\*\/$/ {
c = gsub(/^[^@]*\*\//,"");
if(c > 0) {
OK=1;
}
}
{
line = $0;
#anz = gsub(/function/," function");
#ch = substr(line,length(line));
if (OK == 1) {
if (length(line) > 0) {
#if (ch == "}") {
# if (braces == 0) {
# if (length(line) > 0) {
# print line
# }
# line = ""
# }
#}
#line = line $0;
print line;
}
}
}
' >> $OUT
}
cmp_js() {
pushd $1 >/dev/null
OUT=NagVisCompressed.js
>$OUT
cmp ExtStacktrace.js
cmp ExtLeaflet.js
cmp nagvis.js
cmp edit.js
cmp popupWindow.js
cmp ExtBase.js
cmp frontendMessage.js
cmp frontendEventlog.js
cmp ajax.js
cmp ajaxActions.js
cmp dynfavicon.js
cmp Element.js
cmp ElementContext.js
cmp ElementHover.js
cmp ElementIcon.js
cmp ElementLine.js
cmp ElementGadget.js
cmp ElementLabel.js
cmp ElementShape.js
cmp ElementBox.js
cmp ElementTile.js
cmp View.js
cmp ViewMap.js
cmp ViewWorldmap.js
cmp ViewOverview.js
cmp ViewUrl.js
cmp NagVisObject.js
cmp NagVisStatefulObject.js
cmp NagVisStatelessObject.js
cmp NagVisHost.js
cmp NagVisService.js
cmp NagVisHostgroup.js
cmp NagVisServicegroup.js
cmp NagVisDynGroup.js
cmp NagVisAggr.js
cmp NagVisMap.js
cmp NagVisShape.js
cmp NagVisLine.js
cmp NagVisTextbox.js
cmp NagVisContainer.js
cmp NagVisRotation.js
cmp frontend.js
cmp ExtWzJsGraphics.js
cmp ExtJSColor.js
popd >/dev/null
}