diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-05-15 14:14:14 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-05-15 14:26:54 (EDT) |
commit | 34c2432859bbc108193e86e8caacc995488e04ed (patch) | |
tree | 48d0044f315b32d527f507887c235748f2523952 | |
parent | d03309a89920ebc8c7f61d7bfcc5b3cc4c7836e5 (diff) |
Move plat:all check to ob_plat_is_concerned().
tests/ob_plat_is_concerned.sh now passes.
-rw-r--r-- | lib/metadata.sh | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/lib/metadata.sh b/lib/metadata.sh index 7a7a926..ffeb9d1 100644 --- a/lib/metadata.sh +++ b/lib/metadata.sh @@ -183,13 +183,6 @@ ob_match_plat() fi for p in ${plat_field}; do - if [ "${plat}" = 'all' ]; then - if [ "${p}" = 'all' ]; then - return 0 - else - continue - fi - fi if [ "${p}" = 'any' ]; then return 0 fi @@ -254,27 +247,33 @@ ob_plat_is_concerned() return 125 fi - seen_plat=1 - if [ -z "${plats}" ]; then - seen_plat=0 - fi - - for plat in ${plats}; do - not_plat="${plat#!}" - if [ "${not_plat}" != "${plat}" ]; then - if ob_match_plat "${host_plat}" "${not_plat}"; then - seen_plat=1 - break - else + if [ "x${plats}" = 'x' ]; then + return 0 + elif [ "x${host_plat}" = 'xall' ]; then + if [ "x${plats}" = 'xall' ]; then + return 0 + else + return 1 + fi + else + seen_plat=1 + for plat in ${plats}; do + not_plat="${plat#!}" + if [ "${not_plat}" != "${plat}" ]; then + if ob_match_plat "${host_plat}" "${not_plat}" + then + seen_plat=1 + break + else + seen_plat=0 + fi + elif ob_match_plat "${host_plat}" "${plat}"; then seen_plat=0 + break fi - elif ob_match_plat "${host_plat}" "${plat}"; then - seen_plat=0 - break - fi - done - - return ${seen_plat} + done + return ${seen_plat} + fi } ob_get_system_path() |