From: Adam Sutton Date: Fri, 17 Aug 2012 09:48:45 +0000 (+0100) Subject: Fix enabling of unsupported options from command line. X-Git-Tag: 3.3~164 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba2ebce0110a16d82253cd4003691f98bb622928;p=thirdparty%2Ftvheadend.git Fix enabling of unsupported options from command line. --- diff --git a/support/configure.inc b/support/configure.inc index c80b2ae41..308f4701c 100644 --- a/support/configure.inc +++ b/support/configure.inc @@ -63,7 +63,7 @@ function die # Enable/Disable option function _enable { - local opt=$1 val=$2 row= k= v= + local opt=$1 val=$2 ignore=$3 row= k= v= for row in ${OPTIONS[*]}; do k=${row%:*} [ "$k" == "$opt" ] || continue @@ -73,19 +73,19 @@ function _enable fi return done - OPTIONS=(${OPTIONS[@]} $opt:$val) + [ -z "$ignore" ] && OPTIONS=(${OPTIONS[@]} $opt:$val) } # Enable option function enable { - _enable $1 yes + _enable $1 yes $2 } # Disable option function disable { - _enable $1 no + _enable $1 no $2 } # Enable package @@ -186,11 +186,11 @@ function parse_args ;; enable-*) opt=${opt#*-} - enable $opt + enable $opt 1 ;; disable-*) opt=${opt#*-} - disable $opt + disable $opt 1 ;; esac done