[SCM] debian-live/live-helper branch, master, updated. 1.0_a46-1-10-g08d09da

Chris Lamb chris at chris-lamb.co.uk
Mon Apr 28 16:13:38 UTC 2008


The following commit has been merged in the master branch:
commit 08d09da84f3b9f090e4048f6dab37dc94925ee5a
Author: Chris Lamb <chris at chris-lamb.co.uk>
Date:   Mon Apr 28 17:05:30 2008 +0100

    Allow needle and haystack parts of packagelist #if constructs to be lists
    
    This allows us to write:
    
     #if SECTIONS contrib non-free
     contrib-package
     non-free-package
     #endif
    
    and
    
     #if DISTRIBUTION lenny sid
     new-package
     #endif
    
    
    Signed-off-by: Chris Lamb <chris at chris-lamb.co.uk>

diff --git a/functions/packageslists.sh b/functions/packageslists.sh
index 733e8f2..023b984 100755
--- a/functions/packageslists.sh
+++ b/functions/packageslists.sh
@@ -46,16 +46,22 @@ Expand_packagelist ()
 						echo "E: Nesting conditionals is not supported" >&2
 						exit 1
 					fi
-
 					_LH_NESTED=1
-					_LH_VAR="$(echo "${_LH_LINE}" | cut -d' ' -f2)"
-					_LH_VAL="$(echo "${_LH_LINE}" | cut -d' ' -f3-)"
-					_LH_MATCH="$(echo ${_LH_VAL} |grep "\(^\| \)$(eval "echo \$LH_${_LH_VAR}")\($\| \)")" || true
 
-					if [ -n "${_LH_VAR}" ] &&  [ -z "${_LH_MATCH}" ]
-					then
-						_LH_ENABLED=0
-					fi
+					_LH_NEEDLE="$(echo "${_LH_LINE}" | cut -d' ' -f3-)"
+					_LH_HAYSTACK="$(eval "echo \$LH_$(echo "${_LH_LINE}" | cut -d' ' -f2)")"
+
+					_LH_ENABLED=0
+					for _LH_NEEDLE_PART in ${_LH_NEEDLE}
+					do
+						for _LH_HAYSTACK_PART in ${_LH_HAYSTACK}
+						do
+							if [ "${_LH_NEEDLE_PART}" = "${_LH_HAYSTACK_PART}" ]
+							then
+								_LH_ENABLED=1
+							fi
+						done
+					done
 					;;
 
 				\#endif*)

-- 
debian-live/live-helper



More information about the debian-live-changes mailing list