Browse code

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

Dean Troyer authored on 2012/06/01 06:39:36
Showing 1 changed files
... ...
@@ -632,13 +632,13 @@ function get_packages() {
632 632
                 continue
633 633
             fi
634 634
 
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
642 642
             fi
643 643
 
644 644
             echo ${line%#*}