Fix multiple distro dependency bug

get_packages() icorrectly handled multiple distros listed in a dependency
file, such as:

    xyz  # dist:fred,barney,wilma

Change-Id: Ib1178b2aaaddafe581902b32776180bb0b41f1ae
This commit is contained in:
Dean Troyer 2012-05-31 16:39:36 -05:00
parent d3dde55d4b
commit 3ea1112901
1 changed files with 7 additions and 7 deletions

View File

@ -632,13 +632,13 @@ function get_packages() {
continue
fi
if [[ $line =~ (.*)#.*dist:([^ ]*) ]]; then # We are using BASH regexp matching feature.
package=${BASH_REMATCH[1]}
distros=${BASH_REMATCH[2]}
for distro in ${distros//,/ }; do #In bash ${VAR,,} will lowecase VAR
[[ ${distro,,} == ${DISTRO,,} ]] && echo $package
done
continue
if [[ $line =~ (.*)#.*dist:([^ ]*) ]]; then
# We are using BASH regexp matching feature.
package=${BASH_REMATCH[1]}
distros=${BASH_REMATCH[2]}
# In bash ${VAR,,} will lowecase VAR
[[ ${distros,,} =~ ${DISTRO,,} ]] && echo $package
continue
fi
echo ${line%#*}