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

View File

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

View File

@ -67,9 +67,6 @@ if ($overwrite) {
AirtimeIni::UpdateIniFiles(); 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. // 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); 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::CreateZendPhpLogFile();
//AirtimeInstall::CreateCronFile();
/* FINISHED AIRTIME PHP INSTALLER */ /* FINISHED AIRTIME PHP INSTALLER */

View File

@ -20,7 +20,9 @@ if(exec("whoami") != "root"){
} }
function pause(){ 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"){ if (getenv("AIRTIME_INSTALL_DEBUG") === "1"){
echo "Press Enter to Continue".PHP_EOL; echo "Press Enter to Continue".PHP_EOL;
fgets(STDIN); 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()); set_include_path(__DIR__.'/propel' . PATH_SEPARATOR . get_include_path());
Propel::init(__DIR__."/propel/airtime-conf.php"); Propel::init(__DIR__."/propel/airtime-conf.php");
date_default_timezone_set(exec("cat /etc/timezone"));
const CONF_DIR_BINARIES = "/usr/lib/airtime"; const CONF_DIR_BINARIES = "/usr/lib/airtime";

View File

@ -1,5 +1,7 @@
<?php <?php
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php'); require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
date_default_timezone_set(exec("cat /etc/timezone"));
class Airtime192Upgrade{ class Airtime192Upgrade{
public static function InstallAirtimePhpServerCode($phpDir) public static function InstallAirtimePhpServerCode($phpDir)

View File

@ -1,5 +1,7 @@
<?php <?php
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php'); require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
date_default_timezone_set(exec("cat /etc/timezone"));
class Airtime193Upgrade{ class Airtime193Upgrade{
public static function InstallAirtimePhpServerCode($phpDir) public static function InstallAirtimePhpServerCode($phpDir)

View File

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