Module: nagvis
Branch: master
Commit: 856b982bb029fca33724f6ea9468c5652970628f
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=856b982bb029fca33724f6ea9468c5652970628f

Author: LaMi <[email protected]>
Date:   Tue Mar  9 21:15:18 2010 +0100

Updating configuration files by default now; Added code to remove paths from 
cross updated nagvis.ini.php files

---

 install.sh |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/install.sh b/install.sh
index 125847e..ccbbed2 100755
--- a/install.sh
+++ b/install.sh
@@ -36,7 +36,7 @@ INSTALLER_ACTION="install"
 # Be quiet? (Enable/Disable confirmations)
 INSTALLER_QUIET=0
 # Should the installer change config options when possible?
-INSTALLER_CONFIG_MOD="n"
+INSTALLER_CONFIG_MOD="y"
 # files to ignore/delete
 IGNORE_DEMO=""
 # backends to use
@@ -1165,10 +1165,10 @@ fi
 
 if [ "$INSTALLER_ACTION" = "update" ]; then
        if [ $INSTALLER_QUIET -ne 1 ]; then
-               confirm "Do you want the installer to update your config files 
when possible?" "$INSTALLER_CONFIG_MOD"
-               INSTALLER_CONFIG_MOD=$ANS
-               confirm "Should the backup directory be removed after 
successful installation?" "$REMOVE"
-               REMOVE=$AMOD
+               ask_user "INSTALLER_CONFIG_MOD" "$INSTALLER_CONFIG_MOD" 1 
"check_confirm" \
+                                "Do you want the installer to update your 
config files when possible?"
+               ask_user "REMOVE" "$REMOVE" 1 "check_confirm" \
+                                "Remove backup directory after successful 
installation?"
        fi
 fi
 
@@ -1365,7 +1365,7 @@ if [ "$INSTALLER_ACTION" = "update" -a "$NAGVIS_VER_OLD" 
!= "UNKNOWN" ]; then
        copy "\/(gadgets_core\.php|std_.+\.php)$" "$USERFILES_DIR/gadgets" 
"gadgets"
 
        LINE="Restoring custom stylesheets..."
-  copy "" "$USERFILES_DIR/styles" "stylesheets"
+       copy "" "$USERFILES_DIR/styles" "stylesheets"
        
        # Copy auth.db when updating from 1.5x
        if [ $NAGVIS_TAG_OLD -ge 01050000 ]; then
@@ -1376,17 +1376,28 @@ fi
 text
 
 # Do some update tasks (Changing options, notify about deprecated options)
-if [ "$INSTALLER_ACTION" = "update" -a "$NAGVIS_VER_OLD" != "UNKNOWN" ]; then
+if [ "$INSTALLER_ACTION" = "update" -a "$NAGVIS_VER_OLD" != "UNKNOWN" -a 
"$INSTALLER_CONFIG_MOD" = "y" ]; then
        line 
        text "| Handling changed/removed options" "|"
        line
 
        # Only perform the actions below for NagVis 1.5.x installations
        if [ $NAGVIS_TAG -ge 01050000 ]; then
-               #line "Removing allowedforconfig option from main config..."
                DONE=`log "Removing allowedforconfig option from main 
config..." done`
                sed -i '/^allowedforconfig=/d' $NAGVIS_PATH/etc/nagvis.ini.php
                chk_rc "| Error" "$DONE"
+
+               # Remove base and htmlbase path from cross path updated main
+               # configuration file
+               if [ "$NAGVIS_PATH_OLD" != "$NAGVIS_PATH" ]; then
+                       DONE=`log "Uncommenting base path during cross-path 
update..." done`
+                       sed -i 's/^base=\(.*\)$/;base=\1/g' 
$NAGVIS_PATH/etc/nagvis.ini.php
+                       chk_rc "| Error" "$DONE"
+
+                       DONE=`log "Uncommenting htmlbase path during cross-path 
update..." done`
+                       sed -i 's/^htmlbase=\(.*\)$/;htmlbase=\1/g' 
$NAGVIS_PATH/etc/nagvis.ini.php
+                       chk_rc "| Error" "$DONE"
+               fi
                
                DONE=`log "Removing usegdlibs option from main config..." done`
                sed -i '/^usegdlibs=/d' $NAGVIS_PATH/etc/nagvis.ini.php


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to