From f98bd5b8f269fdd1c82aaa5f598bfb6602d33f12 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 3 Aug 2012 11:13:17 -0400 Subject: [PATCH] CC-4147: Make Airtime work nicer with Debian package generation scripts. -add "--disable-deb-check" option --- install_minimal/airtime-install | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/install_minimal/airtime-install b/install_minimal/airtime-install index d2a329203..020fb1d4b 100755 --- a/install_minimal/airtime-install +++ b/install_minimal/airtime-install @@ -7,16 +7,6 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi -set +e -DEB=$(dpkg -s airtime 2> /dev/null | grep Status) -set -e -if [[ "$DEB" = "Status: install ok installed" ]]; then - echo -e "\nDebian package of Airtime detected. Please use the debian package to upgrade.\n" - 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] @@ -40,8 +30,9 @@ pypo="f" showrecorder="f" web="f" liquidsoap_keep_alive="f" +disable_deb_check="f" -set -- $(getopt -l help,overwrite,preserve,no-db,reinstall,media-monitor,pypo,web,liquidsoap-keep-alive "hopnrmywl" "$@") +set -- $(getopt -l help,overwrite,preserve,no-db,reinstall,media-monitor,pypo,web,liquidsoap-keep-alive,disable-deb-check "hopnrmywld" "$@") while [ $# -gt 0 ] do case "$1" in @@ -54,6 +45,7 @@ do (-y|--pypo) pypo="t";; (-w|--web) web="t";; (-l|--liquidsoap-keep-alive) liquidsoap_keep_alive="t";; + (-d|--disable-deb-check) disable_deb_check="t";; (--) shift; break;; (-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;; @@ -70,6 +62,20 @@ if [ "$mediamonitor" = "f" -a "$pypo" = "f" -a "$web" = "f" ]; then web="t" fi +if [ "$disable_deb_check" == "f" ]; then + set +e + DEB=$(dpkg -s airtime 2> /dev/null | grep Status) + set -e + if [[ "$DEB" = "Status: install ok installed" ]]; then + echo -e "\nDebian package of Airtime detected. Please use the debian package to upgrade.\n" + exit 1 + fi +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 + # Absolute path to this script, e.g. /home/user/bin/foo.sh SCRIPT=`readlink -f $0` # Absolute path this script is in, thus /home/user/bin