diff options
author | Tiago Bortoletto Vaz <tiago@debian-ba.org> | 2008-04-27 19:16:39 -0300 |
---|---|---|
committer | Tiago Bortoletto Vaz <tiago@debian-ba.org> | 2008-04-27 19:16:39 -0300 |
commit | 64b7d8cb867af2333b92cddcc74c217e315c0c55 (patch) | |
tree | 2ae79287f5ae7e09add266e6d249fc2af621181e /functions | |
parent | 14ffd3f15f8fd271f11041a3339685e587c351d0 (diff) | |
download | vyos-live-build-64b7d8cb867af2333b92cddcc74c217e315c0c55.tar.gz vyos-live-build-64b7d8cb867af2333b92cddcc74c217e315c0c55.zip |
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.
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/packageslists.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/functions/packageslists.sh b/functions/packageslists.sh index 5f05a4b36..733e8f2c6 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 |