From b3789774a3ce457ba6e26f518083714f33ce3e16 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 15 Sep 2011 13:50:40 -0400 Subject: [PATCH 1/7] CC-2824: deb 1.7 upgrade to 1.9.4. /usr/share/airtime folder is empty --- install_minimal/include/airtime-upgrade.php | 8 ++++++++ .../upgrades/airtime-1.8.0/airtime-upgrade.php | 9 +++++++++ .../upgrades/airtime-1.9.0/airtime-upgrade.php | 10 ---------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/install_minimal/include/airtime-upgrade.php b/install_minimal/include/airtime-upgrade.php index 5781678e7..bdec799bd 100644 --- a/install_minimal/include/airtime-upgrade.php +++ b/install_minimal/include/airtime-upgrade.php @@ -55,27 +55,35 @@ $SCRIPTPATH = __DIR__; if (strcmp($version, "1.7.0") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.7.0/airtime-upgrade.php"); + readline("Press any key"); } if (strcmp($version, "1.8.0") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.8.0/airtime-upgrade.php"); + readline("Press any key"); } if (strcmp($version, "1.8.1") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.8.1/airtime-upgrade.php"); + readline("Press any key"); } if (strcmp($version, "1.8.2") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.8.2/airtime-upgrade.php"); + readline("Press any key"); } if (strcmp($version, "1.9.0") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.9.0/airtime-upgrade.php"); + readline("Press any key"); } if (strcmp($version, "1.9.2") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.9.2/airtime-upgrade.php"); + readline("Press any key"); } if (strcmp($version, "1.9.3") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.9.3/airtime-upgrade.php"); + readline("Press any key"); } if (strcmp($version, "1.9.4") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.9.4/airtime-upgrade.php"); + readline("Press any key"); } //set the new version in the database. 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 dabbf0b22..068a5a680 100644 --- a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php @@ -238,6 +238,12 @@ function LoadConfig($CC_CONFIG) { return $CC_CONFIG; } +function movePhpFiles($CC_CONFIG){ + $baseDir = $CC_CONFIG['baseFilesDir']; + echo "Copying Server files from $baseDir/airtime_mvc to /var/www"; + exec("copy -R $baseDir/airtime_mvc/* /var/www"); +} + // Backup the config files $suffix = date("Ymdhis")."-1.8.0"; foreach ($configFiles as $conf) { @@ -252,4 +258,7 @@ CreateIniFiles($default_suffix); echo "* Initializing INI files".PHP_EOL; MergeConfigFiles($configFiles, $suffix); + $CC_CONFIG = LoadConfig($CC_CONFIG); + +movePhpFiles($CC_CONFIG); 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 6f1843572..ebcb9358a 100644 --- a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php @@ -581,16 +581,6 @@ class Airtime190Upgrade{ } - // we don't need thses functions anymore as it's done in CreateSymlinksToUtils() - /*public static function removeOldAirtimeImport(){ - exec('rm -f "/usr/bin/airtime-import"'); - } - - public static function updateAirtimeImportSymLink(){ - $dir = "/usr/lib/airtime/utils/airtime-import/airtime-import"; - exec("ln -s $dir /usr/bin/airtime-import"); - }*/ - public static function execSqlQuery($sql){ global $CC_DBC; From 9c724913f4b8fcabef5cb7ef347b0e3354aeff42 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 15 Sep 2011 13:54:44 -0400 Subject: [PATCH 2/7] CC-2824: deb 1.7 upgrade to 1.9.4. /usr/share/airtime folder is empty --- install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 068a5a680..74ac42edf 100644 --- a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php @@ -241,7 +241,7 @@ function LoadConfig($CC_CONFIG) { function movePhpFiles($CC_CONFIG){ $baseDir = $CC_CONFIG['baseFilesDir']; echo "Copying Server files from $baseDir/airtime_mvc to /var/www"; - exec("copy -R $baseDir/airtime_mvc/* /var/www"); + exec("cp -R $baseDir/airtime_mvc/* /var/www"); } // Backup the config files From 2128867b4f35ff327474838e4399bfaab8c3c766 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 15 Sep 2011 14:08:13 -0400 Subject: [PATCH 3/7] CC-2824: deb 1.7 upgrade to 1.9.4. /usr/share/airtime folder is empty --- .../upgrades/airtime-1.8.0/airtime-upgrade.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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 74ac42edf..25b1ba1b6 100644 --- a/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.8.0/airtime-upgrade.php @@ -172,6 +172,9 @@ function MergeConfigFiles($configFiles, $suffix) // Parse with sections $newSettings = parse_ini_file($conf, true); $oldSettings = parse_ini_file("$conf$suffix.bak", true); + + $oldSettings['general']['airtime_dir'] = '/var/www/airtime'; + $oldSettings['general']['base_files_dir'] = '/srv/airtime'; } else { $newSettings = ReadPythonConfig($conf); @@ -239,9 +242,10 @@ function LoadConfig($CC_CONFIG) { } function movePhpFiles($CC_CONFIG){ - $baseDir = $CC_CONFIG['baseFilesDir']; - echo "Copying Server files from $baseDir/airtime_mvc to /var/www"; - exec("cp -R $baseDir/airtime_mvc/* /var/www"); + $phpDir = $CC_CONFIG['phpDir']; + echo "Copying Server files from $phpDir/airtime_mvc to /var/www/airtime"; + exec("mkdir -p /var/www/airtime"); + exec("cp -R $phpDir/airtime_mvc/* /var/www/airtime"); } // Backup the config files @@ -253,12 +257,16 @@ foreach ($configFiles as $conf) { } } + +$CC_CONFIG = LoadConfig($CC_CONFIG); +movePhpFiles($CC_CONFIG); + $default_suffix = "180"; CreateIniFiles($default_suffix); echo "* Initializing INI files".PHP_EOL; + + MergeConfigFiles($configFiles, $suffix); -$CC_CONFIG = LoadConfig($CC_CONFIG); -movePhpFiles($CC_CONFIG); From 23b2802c6415a934a732fdea78c78f771e5e1198 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 15 Sep 2011 15:51:11 -0400 Subject: [PATCH 4/7] CC-2831: airtime-update-db-setting permission error -fixed --- install_minimal/include/AirtimeInstall.php | 2 +- utils/airtime-update-db-settings.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/install_minimal/include/AirtimeInstall.php b/install_minimal/include/AirtimeInstall.php index fd03eab10..bf9a3d55a 100644 --- a/install_minimal/include/AirtimeInstall.php +++ b/install_minimal/include/AirtimeInstall.php @@ -6,7 +6,7 @@ require_once('DB.php'); class AirtimeInstall { const CONF_DIR_BINARIES = "/usr/lib/airtime"; - const CONF_DIR_WWW = "/usr/share/airtime/"; + const CONF_DIR_WWW = "/usr/share/airtime"; const CONF_DIR_LOG = "/var/log/airtime"; public static $databaseTablesCreated = false; diff --git a/utils/airtime-update-db-settings.py b/utils/airtime-update-db-settings.py index 7fc657b4e..ff292a460 100644 --- a/utils/airtime-update-db-settings.py +++ b/utils/airtime-update-db-settings.py @@ -5,10 +5,15 @@ we need to update database host, dbname, username and password. This script reads from airtime.conf. """ import os +import sys import ConfigParser import xml.dom.minidom from xml.dom.minidom import Node +if os.geteuid() != 0: + print "Please run this as root." + sys.exit(1) + #Read the universal values parser = ConfigParser.SafeConfigParser() parser.read('/etc/airtime/airtime.conf') From 3478b954b3ea0b5199aa87b694d1ec773a55de90 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 15 Sep 2011 16:07:34 -0400 Subject: [PATCH 5/7] CC-2824: deb 1.7 upgrade to 1.9.4. /usr/share/airtime folder is empty -fixed --- install_minimal/include/airtime-upgrade.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/install_minimal/include/airtime-upgrade.php b/install_minimal/include/airtime-upgrade.php index bdec799bd..5781678e7 100644 --- a/install_minimal/include/airtime-upgrade.php +++ b/install_minimal/include/airtime-upgrade.php @@ -55,35 +55,27 @@ $SCRIPTPATH = __DIR__; if (strcmp($version, "1.7.0") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.7.0/airtime-upgrade.php"); - readline("Press any key"); } if (strcmp($version, "1.8.0") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.8.0/airtime-upgrade.php"); - readline("Press any key"); } if (strcmp($version, "1.8.1") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.8.1/airtime-upgrade.php"); - readline("Press any key"); } if (strcmp($version, "1.8.2") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.8.2/airtime-upgrade.php"); - readline("Press any key"); } if (strcmp($version, "1.9.0") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.9.0/airtime-upgrade.php"); - readline("Press any key"); } if (strcmp($version, "1.9.2") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.9.2/airtime-upgrade.php"); - readline("Press any key"); } if (strcmp($version, "1.9.3") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.9.3/airtime-upgrade.php"); - readline("Press any key"); } if (strcmp($version, "1.9.4") < 0){ passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini --file $SCRIPTPATH/../upgrades/airtime-1.9.4/airtime-upgrade.php"); - readline("Press any key"); } //set the new version in the database. From d824eb762235e1a4e013a69ed3fcaaedab5ac87f Mon Sep 17 00:00:00 2001 From: martin Date: Sat, 17 Sep 2011 12:36:35 -0400 Subject: [PATCH 6/7] CC-2837: Invalid SQL statement -fixed --- airtime_mvc/application/models/Schedule.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 5b4b37d92..7a27541e4 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -307,9 +307,8 @@ class Schedule { $row["id"] = $row["group_id"]; } } else { - $sql = "SELECT MIN(st.name) AS name," - ." MIN(pt.creator) AS creator," - ." st.group_id, " + $sql = "SELECT MIN(pt.creator) AS creator," + ." st.group_id," ." SUM(st.clip_length) AS clip_length," ." MIN(st.file_id) AS file_id," ." COUNT(*) as count," From 0e503517f507e4cf5227357a44ac843ac437cfd3 Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 18 Sep 2011 19:32:39 -0400 Subject: [PATCH 7/7] CC-2838: Character encoding errors with telnet'ing show name to Liquidsoap -fixed --- python_apps/pypo/liquidsoap_scripts/ls_script.liq | 2 ++ python_apps/pypo/pypopush.py | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/python_apps/pypo/liquidsoap_scripts/ls_script.liq b/python_apps/pypo/liquidsoap_scripts/ls_script.liq index f47179268..03a8dbbea 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_script.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_script.liq @@ -58,6 +58,7 @@ if output_icecast_mp3 then #format = %mp3(bitrate=192, samplerate=44100, stereo=false) ignore(output.icecast(%mp3, + encoding = "UTF-8", host = icecast_host, port = icecast_port, password = icecast_pass, @@ -75,6 +76,7 @@ end if output_icecast_vorbis then if output_icecast_vorbis_metadata then ignore(output.icecast(%vorbis, + encoding = "UTF-8", host = icecast_host, port = icecast_port, password = icecast_pass, diff --git a/python_apps/pypo/pypopush.py b/python_apps/pypo/pypopush.py index 21d2a42b9..d427499a2 100644 --- a/python_apps/pypo/pypopush.py +++ b/python_apps/pypo/pypopush.py @@ -162,9 +162,11 @@ class PypoPush(Thread): logger.debug('Preparing to push playlist %s' % pkey) for item in playlist: - annotate = str(item['annotate']) - tn.write(('queue.push %s\n' % annotate).encode('latin-1')) - tn.write(('vars.show_name %s\n' % item['show_name']).encode('latin-1')) + annotate = item['annotate'] + tn.write(str('queue.push %s\n' % annotate.encode('utf-8'))) + + show_name = item['show_name'] + tn.write(str('vars.show_name %s\n' % show_name.encode('utf-8'))) tn.write("exit\n") logger.debug(tn.read_all())