From e10c468aac43aaf890a102c416505957f9b6d592 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 22 Jul 2011 09:09:40 -0400 Subject: [PATCH 1/2] CC-2586: airtime-check-system checks system pacakge - fixed --- utils/airtime-check-system.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/airtime-check-system.php b/utils/airtime-check-system.php index fd8879f0c..277d6018f 100644 --- a/utils/airtime-check-system.php +++ b/utils/airtime-check-system.php @@ -259,7 +259,7 @@ class AirtimeCheck { } private static function CheckPythonLibrary($lib, $minVersion){ - $command = "pip freeze | grep $lib"; + $command = "/usr/lib/airtime/airtime_virtualenv/bin/pip freeze | grep $lib"; exec($command, $output, $result); $status = AirtimeCheck::CHECK_FAILED; From d1494c17358607350bd00e8767b4121a99d07ae0 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 22 Jul 2011 10:30:08 -0400 Subject: [PATCH 2/2] CC-2579: Upgrade fails from 1.8->1.9 - airtime.conf files for each version were added. - Custom CreateIniFiles() were added for 1.8.0 and 1.7.0 upgrade script - 1.9.0 upgraded deletes all files in /usr/lib/airtime/ except airtime_virtualenv. --- airtime_mvc/build/airtime.conf.170 | 22 +++++++++++ airtime_mvc/build/airtime.conf.180 | 22 +++++++++++ airtime_mvc/build/airtime.conf.181 | 22 +++++++++++ airtime_mvc/build/airtime.conf.182 | 24 ++++++++++++ .../airtime-1.7.0/airtime-upgrade.php | 37 ++++++++++++++++++- .../airtime-1.8.0/airtime-upgrade.php | 36 +++++++++++++++++- .../airtime-1.8.1/airtime-upgrade.php | 2 +- .../airtime-1.8.2/airtime-upgrade.php | 2 +- .../airtime-1.9.0/airtime-upgrade.php | 3 +- 9 files changed, 165 insertions(+), 5 deletions(-) create mode 100644 airtime_mvc/build/airtime.conf.170 create mode 100644 airtime_mvc/build/airtime.conf.180 create mode 100644 airtime_mvc/build/airtime.conf.181 create mode 100644 airtime_mvc/build/airtime.conf.182 diff --git a/airtime_mvc/build/airtime.conf.170 b/airtime_mvc/build/airtime.conf.170 new file mode 100644 index 000000000..9135f09e4 --- /dev/null +++ b/airtime_mvc/build/airtime.conf.170 @@ -0,0 +1,22 @@ +[database] +host = localhost +dbname = airtime +dbuser = airtime +dbpass = airtime + +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = guest +password = guest +vhost = / + +[general] +api_key = AAA +web_server_user = www-data +airtime_dir = x +base_files_dir = x + +[soundcloud] +connection_retries = 3 +time_between_retries = 60 diff --git a/airtime_mvc/build/airtime.conf.180 b/airtime_mvc/build/airtime.conf.180 new file mode 100644 index 000000000..9135f09e4 --- /dev/null +++ b/airtime_mvc/build/airtime.conf.180 @@ -0,0 +1,22 @@ +[database] +host = localhost +dbname = airtime +dbuser = airtime +dbpass = airtime + +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = guest +password = guest +vhost = / + +[general] +api_key = AAA +web_server_user = www-data +airtime_dir = x +base_files_dir = x + +[soundcloud] +connection_retries = 3 +time_between_retries = 60 diff --git a/airtime_mvc/build/airtime.conf.181 b/airtime_mvc/build/airtime.conf.181 new file mode 100644 index 000000000..9135f09e4 --- /dev/null +++ b/airtime_mvc/build/airtime.conf.181 @@ -0,0 +1,22 @@ +[database] +host = localhost +dbname = airtime +dbuser = airtime +dbpass = airtime + +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = guest +password = guest +vhost = / + +[general] +api_key = AAA +web_server_user = www-data +airtime_dir = x +base_files_dir = x + +[soundcloud] +connection_retries = 3 +time_between_retries = 60 diff --git a/airtime_mvc/build/airtime.conf.182 b/airtime_mvc/build/airtime.conf.182 new file mode 100644 index 000000000..982d5a762 --- /dev/null +++ b/airtime_mvc/build/airtime.conf.182 @@ -0,0 +1,24 @@ +[database] +host = localhost +dbname = airtime +dbuser = airtime +dbpass = airtime + +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = guest +password = guest +vhost = / + +[general] +api_key = AAA +web_server_user = www-data +airtime_dir = x +base_files_dir = x +base_url = localhost +base_port = 80 + +[soundcloud] +connection_retries = 3 +time_between_retries = 60 diff --git a/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php index be0431db6..89e157c88 100644 --- a/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.7.0/airtime-upgrade.php @@ -9,7 +9,42 @@ require_once(dirname(__FILE__).'/../../include/AirtimeIni.php'); require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php'); -AirtimeIni::CreateIniFiles(); + +/** +* This function creates the /etc/airtime configuration folder +* and copies the default config files to it. +*/ +function CreateIniFiles() +{ + global $AIRTIME_SRC; + global $AIRTIME_PYTHON_APPS; + + if (!file_exists("/etc/airtime/")){ + if (!mkdir("/etc/airtime/", 0755, true)){ + echo "Could not create /etc/airtime/ directory. Exiting."; + exit(1); + } + } + + if (!copy($AIRTIME_SRC."/build/airtime.conf.170", CONF_FILE_AIRTIME)){ + echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/pypo/pypo.cfg", CONF_FILE_PYPO)){ + echo "Could not copy pypo.cfg to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/show-recorder/recorder.cfg", CONF_FILE_RECORDER)){ + echo "Could not copy recorder.cfg to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/pypo/liquidsoap_scripts/liquidsoap.cfg", CONF_FILE_LIQUIDSOAP)){ + echo "Could not copy liquidsoap.cfg to /etc/airtime/. Exiting."; + exit(1); + } +} + +CreateIniFiles(); AirtimeIni::UpdateIniFiles(); echo PHP_EOL."*** Updating Database Tables ***".PHP_EOL; diff --git a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php index 55ea0272b..b38f0dde6 100644 --- a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php @@ -53,8 +53,42 @@ foreach ($configFiles as $conf) { } } +/** +* This function creates the /etc/airtime configuration folder +* and copies the default config files to it. +*/ +function CreateIniFiles() +{ + global $AIRTIME_SRC; + global $AIRTIME_PYTHON_APPS; + + if (!file_exists("/etc/airtime/")){ + if (!mkdir("/etc/airtime/", 0755, true)){ + echo "Could not create /etc/airtime/ directory. Exiting."; + exit(1); + } + } + + if (!copy($AIRTIME_SRC."/build/airtime.conf.180", CONF_FILE_AIRTIME)){ + echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/pypo/pypo.cfg", CONF_FILE_PYPO)){ + echo "Could not copy pypo.cfg to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/show-recorder/recorder.cfg", CONF_FILE_RECORDER)){ + echo "Could not copy recorder.cfg to /etc/airtime/. Exiting."; + exit(1); + } + if (!copy($AIRTIME_PYTHON_APPS."/pypo/liquidsoap_scripts/liquidsoap.cfg", CONF_FILE_LIQUIDSOAP)){ + echo "Could not copy liquidsoap.cfg to /etc/airtime/. Exiting."; + exit(1); + } +} + echo "* Creating INI files".PHP_EOL; -AirtimeIni::CreateIniFiles(); +CreateIniFiles(); AirtimeInstall::InstallPhpCode(); AirtimeInstall::InstallBinaries(); diff --git a/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php index cec3769b8..46b8f7ebd 100644 --- a/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.1/airtime-upgrade.php @@ -122,7 +122,7 @@ function CreateIniFiles() } } - if (!copy($AIRTIME_SRC."/build/airtime.conf", CONF_FILE_AIRTIME)){ + if (!copy($AIRTIME_SRC."/build/airtime.conf.181", CONF_FILE_AIRTIME)){ echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; exit(1); } diff --git a/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php index a5ae869c6..a19aee382 100644 --- a/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.2/airtime-upgrade.php @@ -122,7 +122,7 @@ function CreateIniFiles() } } - if (!copy($AIRTIME_SRC."/build/airtime.conf", CONF_FILE_AIRTIME)){ + if (!copy($AIRTIME_SRC."/build/airtime.conf.182", CONF_FILE_AIRTIME)){ echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; exit(1); } diff --git a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php index 9de5192f3..290e952d2 100644 --- a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php @@ -535,7 +535,8 @@ class Airtime190Upgrade{ public static function UninstallBinaries() { echo "* Removing Airtime binaries from ".CONF_DIR_BINARIES.PHP_EOL; - exec('rm -rf "'.CONF_DIR_BINARIES.'"'); + $command = "rm -rf $(ls -d /usr/lib/airtime/* | grep -v airtime_virtualenv)"; + exec($command); }