Author: Lars Michelsen <[email protected]>
Date: Fri Jun 29 09:03:24 2012 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Fri Jun 29 09:03:24 2012 +0200
Moved javascript compress code to make it available in omd_install script
---
ChangeLog | 3 ++
install.sh | 93 ++------------------------------------------------------
install_lib | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
omd_install.sh | 4 ++
4 files changed, 102 insertions(+), 90 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f0de31b..7f32ead 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,9 @@ Frontend
* Bugfix: Fixed icons not being displayed in IE (version 9 in this case)
* Bugfix: Fixed rendering errors in IE (below version 9)
+Installer
+ * Moved javascript compress code to make it available in omd_install script
+
1.7b2
Core
* Checking conf.d directory modification time to detect removed config files
diff --git a/install.sh b/install.sh
index d6f32b4..5cc02fc 100755
--- a/install.sh
+++ b/install.sh
@@ -95,6 +95,8 @@ GREP_INCOMPLETE=0
# Function definitions
###############################################################################
+. install_lib
+
# format version string
fmt_version() {
V=${1//a/.0.0}
@@ -849,95 +851,6 @@ makedir() {
fi
}
-cmp() {
- 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() {
- cd $NAGVIS_PATH/share/frontend/nagvis-js/js/
- OUT=NagVisCompressed.js
- >$OUT
- cmp ExtStacktrace.js
- cmp nagvis.js
- cmp edit.js
- cmp popupWindow.js
- cmp ExtBase.js
- cmp frontendMessage.js
- cmp frontendEventlog.js
- cmp frontendHover.js
- cmp hover.js
- cmp frontendContext.js
- cmp ajax.js
- cmp ajaxActions.js
- cmp dynfavicon.js
- cmp frontend.js
- cmp lines.js
- cmp NagVisObject.js
- cmp NagVisStatefulObject.js
- cmp NagVisStatelessObject.js
- cmp NagVisHost.js
- cmp NagVisService.js
- cmp NagVisHostgroup.js
- cmp NagVisServicegroup.js
- cmp NagVisMap.js
- cmp NagVisShape.js
- cmp NagVisLine.js
- cmp NagVisTextbox.js
- cmp NagVisRotation.js
- cmp ExtWzJsGraphics.js
- cmp ExtGenericResize.js
- cmp ExtJSColor.js
-}
-
# Main program starting
###############################################################################
@@ -1345,7 +1258,7 @@ makedir "$NAGVIS_PATH/etc/profiles"
copy "README" "$NAGVIS_PATH"
copy "LICENCE" "$NAGVIS_PATH"
copy "docs" "$NAGVIS_PATH/share/" "" "*/cleanup_new_notes.sh"
-cmp_js
+cmp_js $NAGVIS_PATH/share/frontend/nagvis-js/js
# Remove demo maps if desired
if [ "$IGNORE_DEMO" != "" ]; then
diff --git a/install_lib b/install_lib
new file mode 100644
index 0000000..e2ecb4e
--- /dev/null
+++ b/install_lib
@@ -0,0 +1,92 @@
+# Holds common install function used e.g. by install.sh and omd_install.sh
+
+cmp() {
+ 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
+ pwd
+ OUT=NagVisCompressed.js
+ >$OUT
+ cmp ExtStacktrace.js
+ cmp nagvis.js
+ cmp edit.js
+ cmp popupWindow.js
+ cmp ExtBase.js
+ cmp frontendMessage.js
+ cmp frontendEventlog.js
+ cmp frontendHover.js
+ cmp hover.js
+ cmp frontendContext.js
+ cmp ajax.js
+ cmp ajaxActions.js
+ cmp dynfavicon.js
+ cmp frontend.js
+ cmp lines.js
+ cmp NagVisObject.js
+ cmp NagVisStatefulObject.js
+ cmp NagVisStatelessObject.js
+ cmp NagVisHost.js
+ cmp NagVisService.js
+ cmp NagVisHostgroup.js
+ cmp NagVisServicegroup.js
+ cmp NagVisMap.js
+ cmp NagVisShape.js
+ cmp NagVisLine.js
+ cmp NagVisTextbox.js
+ cmp NagVisRotation.js
+ cmp ExtWzJsGraphics.js
+ cmp ExtGenericResize.js
+ cmp ExtJSColor.js
+ popd >/dev/null
+}
diff --git a/omd_install.sh b/omd_install.sh
index 3dfdf8e..823dc13 100755
--- a/omd_install.sh
+++ b/omd_install.sh
@@ -47,6 +47,8 @@ fi
CWD="$(cd "$(dirname "$0")" && pwd)"
+. $CWD/install_lib
+
echo "Installing..."
# 1.5 had the userfiles dir in $OMD_ROOT/var/nagvis/userfiles
@@ -63,6 +65,8 @@ mkdir -p $OMD_ROOT/local/share/nagvis/htdocs
cp -r $CWD/share/* $OMD_ROOT/local/share/nagvis/htdocs
cp -r $CWD/docs $OMD_ROOT/local/share/nagvis/htdocs/
+cmp_js $OMD_ROOT/local/share/nagvis/htdocs/frontend/nagvis-js/js
+
# Update "old" (1.5) userfiles dir
if [ -d $OMD_ROOT/var/nagvis/userfiles ]; then
cp -r $CWD/share/userfiles/* $OMD_ROOT/var/nagvis/userfiles
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins