From cd97e1bbb1a0260f2340ac18dbf21da0304284d5 Mon Sep 17 00:00:00 2001 From: Tiago Bortoletto Vaz Date: Sun, 27 Apr 2008 19:16:39 -0300 Subject: Support list of items for conditionals in package lists This patch allows giving a list of items for the conditionals in package lists. For example, it's possible to specify some packages for more than one architecture in the same conditional block: package01 #if ARCHITECTURE i386 amd64 package02 package03 #endif package04 where package01 and package04 are available for all architectures, but package02 and package03 are available only for i386 and amd64 architectures. --- functions/packageslists.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions/packageslists.sh b/functions/packageslists.sh index 5f05a4b..733e8f2 100755 --- a/functions/packageslists.sh +++ b/functions/packageslists.sh @@ -49,9 +49,10 @@ Expand_packagelist () _LH_NESTED=1 _LH_VAR="$(echo "${_LH_LINE}" | cut -d' ' -f2)" - _LH_VAL="$(echo "${_LH_LINE}" | cut -d' ' -f3)" + _LH_VAL="$(echo "${_LH_LINE}" | cut -d' ' -f3-)" + _LH_MATCH="$(echo ${_LH_VAL} |grep "\(^\| \)$(eval "echo \$LH_${_LH_VAR}")\($\| \)")" || true - if [ -n "${_LH_VAR}" ] && [ "$(eval "echo \$LH_${_LH_VAR}")" != "${_LH_VAL}" ] + if [ -n "${_LH_VAR}" ] && [ -z "${_LH_MATCH}" ] then _LH_ENABLED=0 fi -- cgit v1.0