Skip to content

Commit 3ea1112

Browse files
author
Dean Troyer
committed
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
1 parent d3dde55 commit 3ea1112

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

stack.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -632,13 +632,13 @@ function get_packages() {
632632
continue
633633
fi
634634

635-
if [[ $line =~ (.*)#.*dist:([^ ]*) ]]; then # We are using BASH regexp matching feature.
636-
package=${BASH_REMATCH[1]}
637-
distros=${BASH_REMATCH[2]}
638-
for distro in ${distros//,/ }; do #In bash ${VAR,,} will lowecase VAR
639-
[[ ${distro,,} == ${DISTRO,,} ]] && echo $package
640-
done
641-
continue
635+
if [[ $line =~ (.*)#.*dist:([^ ]*) ]]; then
636+
# We are using BASH regexp matching feature.
637+
package=${BASH_REMATCH[1]}
638+
distros=${BASH_REMATCH[2]}
639+
# In bash ${VAR,,} will lowecase VAR
640+
[[ ${distros,,} =~ ${DISTRO,,} ]] && echo $package
641+
continue
642642
fi
643643

644644
echo ${line%#*}

0 commit comments

Comments
 (0)