From 3f10f94d8f59dc61f172bde85a1d1e37eefac250 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 3 Aug 2012 09:42:41 -0400 Subject: [PATCH] CC-4147: Make Airtime work nicer with Debian package generation scripts. -liquidsoap is installed from sofab repo -make sure new deb-multimedia name takes effect --- install_full/ubuntu/airtime-full-install | 23 +++++++++++++--- install_minimal/airtime-install | 3 +++ python_apps/pypo/install/pypo-initialize.py | 29 +++++---------------- python_apps/pypo/liquidsoap_bin | 2 +- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/install_full/ubuntu/airtime-full-install b/install_full/ubuntu/airtime-full-install index 78158f7f9..b97df1757 100755 --- a/install_full/ubuntu/airtime-full-install +++ b/install_full/ubuntu/airtime-full-install @@ -25,9 +25,12 @@ echo "----------------------------------------------------" dist=`lsb_release -is` if [ "$dist" = "Debian" ]; then - grep "deb http://www.debian-multimedia.org squeeze main non-free" /etc/apt/sources.list - if [ "$?" -ne "0" ]; then - echo "deb http://www.debian-multimedia.org squeeze main non-free" >> /etc/apt/sources.list + set +e + grep -E "deb +http://www.deb-multimedia.org/? squeeze +main +non-free" /etc/apt/sources.list + returncode=$? + set -e + if [ "$returncode" -ne "0" ]; then + echo "deb http://www.deb-multimedia.org squeeze main non-free" >> /etc/apt/sources.list fi fi @@ -55,6 +58,20 @@ else apt-get -y install libzend-framework-php fi +#Install Sourcefabric's custom Liquidsoap debian package +codename=`lsb_release -sc` + +set +e +grep -E "deb +http://apt.sourcefabric.org/? +$codename +main" /etc/apt/sources.list +returncode=$? +set -e +if [ "$returncode" != "0" ]; then + echo "deb http://apt.sourcefabric.org/ $codename main" >> /etc/apt/sources.list +fi +apt-get install -y --force-yes sourcefabric-keyring +apt-get install -y liquidsoap + + # Apache Config File echo "----------------------------------------------------" echo "2. Apache Config File" diff --git a/install_minimal/airtime-install b/install_minimal/airtime-install index 4a9ff3a25..d2a329203 100755 --- a/install_minimal/airtime-install +++ b/install_minimal/airtime-install @@ -15,6 +15,9 @@ if [[ "$DEB" = "Status: install ok installed" ]]; then exit 1 fi +#Update apt sources.list to point to the new deb-multimedia domain. +sed -i s/www.debian-multimedia.org/www.deb-multimedia.org/g /etc/apt/sources.list + showhelp () { echo "Usage: airtime-install [options] --help|-h Displays usage information. diff --git a/python_apps/pypo/install/pypo-initialize.py b/python_apps/pypo/install/pypo-initialize.py index 12eb870ca..964422c37 100644 --- a/python_apps/pypo/install/pypo-initialize.py +++ b/python_apps/pypo/install/pypo-initialize.py @@ -83,30 +83,13 @@ try: print " * Installing Liquidsoap binary" - binary_path = os.path.join(PATH_LIQUIDSOAP_BIN, "liquidsoap_%s_%s" % (codename, arch)) + p = Popen("which liquidsoap", shell=True, stdout=PIPE) + liq_path = p.communicate()[0].strip() - try: - open(binary_path) - - try: - os.remove("/usr/bin/airtime-liquidsoap") - except OSError, e: - #only get here if it doesn't exist - pass - - os.symlink(binary_path, "/usr/bin/airtime-liquidsoap") - except IOError, e: - """ - shutil.copy can throw this exception for two reasons. First reason is that it cannot open the source file. - This is when the liquidsoap file we requested does not exist, and therefore tells the user we don't support - their OS/System architecture. The second reason for this exception is the shutil.copy cannot open the target file. - Since this script is being run as root (and we cannot install to a read-only device), this should never happen. So - it is safe to assume this exception is a result of the first case. - - Note: We cannot simply use os.path.exists before this, since it sometimes gives us "false" incorrectly - """ - print "Unsupported OS/system architecture." - print e + if p.returncode == 0: + os.symlink(liq_path, "/usr/bin/airtime-liquidsoap") + else: + print " * Liquidsoap binary not found!" sys.exit(1) #initialize init.d scripts diff --git a/python_apps/pypo/liquidsoap_bin b/python_apps/pypo/liquidsoap_bin index 492242f4b..e62b9e552 160000 --- a/python_apps/pypo/liquidsoap_bin +++ b/python_apps/pypo/liquidsoap_bin @@ -1 +1 @@ -Subproject commit 492242f4bb7367afebbf2f096067cb5a5d3c0449 +Subproject commit e62b9e552d7d656cddabfdc3c384c86f8b97fd4a