CC-3098: Upgrade scripts don't work

-minor tweaks
This commit is contained in:
Martin Konecny 2011-11-23 16:49:03 -05:00
parent 54f6ea6f81
commit e93b02ef34
8 changed files with 30 additions and 19 deletions

View File

@ -7,8 +7,6 @@ if [ `whoami` != 'root' ]; then
exit 1
fi
export AIRTIME_INSTALL_DEBUG=1
set +e
DEB=$(dpkg -s airtime 2> /dev/null | grep Status)
set -e
@ -25,11 +23,19 @@ AIRTIMEROOT=$SCRIPTPATH/../
# Check if airtime exists already
set +e
DO_UPGRADE="0"
php --php-ini ${SCRIPTPATH}/airtime-php.ini ${SCRIPTPATH}/include/airtime-installed-check.php $@
result=$?
set -e
if [ "$result" -eq "1" ]; then
DO_UPGRADE="1"
fi
#make DO_UPGRADE available in sub bash scripts
export DO_UPGRADE
if [ "$result" = "2" -o "$result" = "3" ]; then
#error message has already been printed inside the php script
exit 1
fi
@ -44,7 +50,7 @@ virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
python $AIRTIMEROOT/python_apps/create-pypo-user.py
if [ "$result" = "1" ]; then
if [ "$DO_UPGRADE" = "1" ]; then
#do upgrade
php --php-ini ${SCRIPTPATH}/airtime-php.ini ${SCRIPTPATH}/include/airtime-upgrade.php $@
fi

View File

@ -18,13 +18,15 @@ AIRTIMEROOT=$SCRIPTPATH/../../
#. ${virtualenv_bin}activate
set +e
php --php-ini ${SCRIPTPATH}/../airtime-php.ini ${SCRIPTPATH}/airtime-install.php $@
result=$?
if [ "$DO_UPGRADE" -eq "0" ]; then
php --php-ini ${SCRIPTPATH}/../airtime-php.ini ${SCRIPTPATH}/airtime-install.php $@
result=$?
if [ "$result" -ne "0" ]; then
#There was an error, exit with error code.
echo "There was an error during install. Exit code $result"
exit 1
if [ "$result" -ne "0" ]; then
#There was an error, exit with error code.
echo "There was an error during install. Exit code $result"
exit 1
fi
fi
set -e

View File

@ -67,9 +67,6 @@ if ($overwrite) {
AirtimeIni::UpdateIniFiles();
}
//AirtimeInstall::InstallPhpCode(); //copies contents of airtime_mvc to /usr/share
//AirtimeInstall::InstallBinaries(); //copies utils to /usr/lib/airtime
// Update the build.properties file to point to the correct directory.
AirtimeIni::UpdateIniValue(AirtimeInstall::CONF_DIR_WWW.'/build/build.properties', 'project.home', AirtimeInstall::CONF_DIR_WWW);
@ -89,10 +86,6 @@ if ($db_install) {
}
}
//AirtimeInstall::CreateSymlinksToUtils();
AirtimeInstall::CreateZendPhpLogFile();
//AirtimeInstall::CreateCronFile();
/* FINISHED AIRTIME PHP INSTALLER */

View File

@ -20,7 +20,9 @@ if(exec("whoami") != "root"){
}
function pause(){
/* change "AIRTIME_INSTALL_DEBUG=1" in base install file to enable this. */
/* Type "sudo -s" to change to root user then type "export AIRTIME_INSTALL_DEBUG=1" and then
* start airtime-install to enable this feature. Is used to pause between upgrade scripts
* to examine the state of the system and see if everything is as expected. */
if (getenv("AIRTIME_INSTALL_DEBUG") === "1"){
echo "Press Enter to Continue".PHP_EOL;
fgets(STDIN);

View File

@ -16,6 +16,8 @@ require_once 'propel/runtime/lib/Propel.php';
set_include_path(__DIR__.'/propel' . PATH_SEPARATOR . get_include_path());
Propel::init(__DIR__."/propel/airtime-conf.php");
date_default_timezone_set(exec("cat /etc/timezone"));
const CONF_DIR_BINARIES = "/usr/lib/airtime";

View File

@ -1,5 +1,7 @@
<?php
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
date_default_timezone_set(exec("cat /etc/timezone"));
class Airtime192Upgrade{
public static function InstallAirtimePhpServerCode($phpDir)
@ -183,4 +185,4 @@
$phpDir = $values['general']['airtime_dir'];
Airtime192Upgrade::InstallAirtimePhpServerCode($phpDir);
AirtimeInstall::CreateSymlinksToUtils();
?>
?>

View File

@ -1,5 +1,7 @@
<?php
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
date_default_timezone_set(exec("cat /etc/timezone"));
class Airtime193Upgrade{
public static function InstallAirtimePhpServerCode($phpDir)
@ -174,4 +176,4 @@
$phpDir = $values['general']['airtime_dir'];
Airtime193Upgrade::InstallAirtimePhpServerCode($phpDir);
AirtimeInstall::CreateSymlinksToUtils();
?>
?>

View File

@ -1,5 +1,7 @@
<?php
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
date_default_timezone_set(exec("cat /etc/timezone"));
class Airtime194Upgrade{
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";