From 798b48c6b38259dd39d60465033f3cad98e362fd Mon Sep 17 00:00:00 2001 From: tomas Date: Wed, 12 Jan 2005 17:55:20 +0000 Subject: [PATCH] fixed: http://bugs.campware.org/view.php?id=541 --- .../modules/storageServer/bin/setupDirs.sh | 5 +-- .../storageServer/var/install/install.php | 35 +++++++++++-------- .../storageServer/var/install/uninstall.php | 20 ++++++----- 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/livesupport/modules/storageServer/bin/setupDirs.sh b/livesupport/modules/storageServer/bin/setupDirs.sh index 7fa6a03bf..405fbb810 100755 --- a/livesupport/modules/storageServer/bin/setupDirs.sh +++ b/livesupport/modules/storageServer/bin/setupDirs.sh @@ -22,7 +22,7 @@ # # # Author : $Author: tomas $ -# Version : $Revision: 1.2 $ +# Version : $Revision: 1.3 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/bin/setupDirs.sh,v $ #------------------------------------------------------------------------------- @@ -31,7 +31,8 @@ #------------------------------------------------------------------------------- WWW_ROOT=`cd var/install; php -q getWwwRoot.php` || exit $? -echo "# storageServer root URL: $WWW_ROOT" +echo "#StorageServer step 1:" +echo "# root URL: $WWW_ROOT" HTTP_GROUP=`bin/getUrl.sh $WWW_ROOT/install/getGname.php` || \ { diff --git a/livesupport/modules/storageServer/var/install/install.php b/livesupport/modules/storageServer/var/install/install.php index b476690e1..9d4380701 100644 --- a/livesupport/modules/storageServer/var/install/install.php +++ b/livesupport/modules/storageServer/var/install/install.php @@ -23,13 +23,15 @@ Author : $Author: tomas $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/install/install.php,v $ ------------------------------------------------------------------------------*/ require_once '../conf.php'; require_once 'DB.php'; require_once '../GreenBox.php'; +require_once "../Transport.php"; +require_once "../Prefs.php"; function errCallback($err) { @@ -57,19 +59,26 @@ if(PEAR::isError($dbc)){ } $dbc->setFetchMode(DB_FETCHMODE_ASSOC); -$gb = &new GreenBox(&$dbc, $config); +$gb =& new GreenBox(&$dbc, $config); +$tr =& new Transport(&$dbc, $config); +$pr =& new Prefs(&$gb); -echo "\n# storageServer: Install ...\n"; +echo "#StorageServer step 2:\n# trying uninstall ...\n"; $dbc->setErrorHandling(PEAR_ERROR_RETURN); +$pr->uninstall(); +$tr->uninstall(); $gb->uninstall(); -PEAR::setErrorHandling(PEAR_ERROR_PRINT, "%s
\n"); + +echo "# Install ...\n"; +#PEAR::setErrorHandling(PEAR_ERROR_PRINT, "%s
\n"); +PEAR::setErrorHandling(PEAR_ERROR_DIE, "%s
\n"); $r = $gb->install(); if(PEAR::isError($r)){ echo $r->getUserInfo()."\n"; exit; } -echo "# Testing ...\n"; +echo "# Testing ...\n"; $gb->test(); $log = $gb->test_log; -echo " TESTS:\n{$log}"; +if($log) echo "# testlog:\n{$log}"; #echo "# Reinstall + testdata insert ...\n"; #$gb->reinstall(); @@ -80,7 +89,7 @@ echo " TESTS:\n{$log}"; #echo "# TREE DUMP:\n"; #echo $gb->dumpTree(); -echo "# Delete test data ...\n"; +echo "# Delete test data ...\n"; $gb->deleteData(); if(!($fp = @fopen($config['storageDir']."/_writeTest", 'w'))){ @@ -89,22 +98,20 @@ if(!($fp = @fopen($config['storageDir']."/_writeTest", 'w'))){ exit(1); }else{ fclose($fp); unlink($config['storageDir']."/_writeTest"); - echo "#storageServer install: OK\n\n"; + echo "#storageServer main: OK\n"; } -echo "# Install Transport submodule\n"; -require_once "../Transport.php"; -$tr =& new Transport(&$dbc, $config); +echo "# Install Transport submodule ..."; $r = $tr->install(); if(PEAR::isError($r)){ echo $r->getUserInfo()."\n"; exit; } echo "\n"; -echo "# Install Prefs submodule\n"; -require_once "../Prefs.php"; -$pr =& new Prefs(&$gb); +echo "# Install Prefs submodule ..."; $r = $pr->install(); if(PEAR::isError($r)){ echo $r->getUserInfo()."\n"; exit; } echo "\n"; +echo "#storageServer submodules: OK\n"; +echo "\n"; $dbc->disconnect(); ?> diff --git a/livesupport/modules/storageServer/var/install/uninstall.php b/livesupport/modules/storageServer/var/install/uninstall.php index bb66b1029..5713df01f 100644 --- a/livesupport/modules/storageServer/var/install/uninstall.php +++ b/livesupport/modules/storageServer/var/install/uninstall.php @@ -23,13 +23,15 @@ Author : $Author: tomas $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/install/uninstall.php,v $ ------------------------------------------------------------------------------*/ require_once '../conf.php'; require_once 'DB.php'; require_once '../GreenBox.php'; +require_once "../Transport.php"; +require_once "../Prefs.php"; function errCallback($err) { @@ -52,26 +54,26 @@ if(PEAR::isError($dbc)){ exit(1); } +echo "#StorageServer uninstall:\n"; $dbc->setFetchMode(DB_FETCHMODE_ASSOC); $gb = &new GreenBox(&$dbc, $config); -# $dbc->setErrorHandling(PEAR_ERROR_RETURN); - -echo "# Uninstall Prefs submodule\n"; -require_once "../Prefs.php"; +$tr =& new Transport(&$dbc, $config); $pr =& new Prefs(&$gb); +$dbc->setErrorHandling(PEAR_ERROR_RETURN); + +echo "# Uninstall Prefs submodule"; $r = $pr->uninstall(); if(PEAR::isError($r)){ echo $r->getUserInfo()."\n"; exit; } echo "\n"; -echo "# Uninstall Transport submodule ...\n"; -require_once "../Transport.php"; -$tr =& new Transport(&$dbc, $config); +echo "# Uninstall Transport submodule ..."; $r = $tr->uninstall(); if(PEAR::isError($r)){ echo $r->getUserInfo()."\n"; exit; } echo "\n"; -echo "# StorageServer uninstall ...\n"; +echo "# Uninstall StorageServer ...\n"; $gb->uninstall(); +echo "#StorageServer uninstall: OK\n"; $dbc->disconnect(); ?>