summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/metadata.sh46
1 files changed, 19 insertions, 27 deletions
diff --git a/lib/metadata.sh b/lib/metadata.sh
index 9249f87..80ec274 100644
--- a/lib/metadata.sh
+++ b/lib/metadata.sh
@@ -161,43 +161,35 @@ ob_get_system_plat()
_ob_match_arch()
{
local match_arch="${1}"
- local arch_field="${2}"
+ local field_arch="${2}"
shift 2 || _ob_abort
- local field_arch=
local match_arch_rest=
local field_arch_rest=
local match_arch_part=
local field_arch_part=
- for field_arch in ${arch_field}; do
-
- # "foo-bar-baz" == "any"
- if [ x"${field_arch}" = x'any' ]; then
- return 0
- fi
-
- # "foo-bar-baz" == "foo-any-any"
- match_arch_rest="${match_arch}"
- field_arch_rest="${field_arch}"
- while [ -n "${match_arch_rest}" ] && [ -n "${field_arch_rest}" ]
- do
- IFS='-' read match_arch_part match_arch_rest <<-EOF
- ${match_arch_rest}
- EOF
- IFS='-' read field_arch_part field_arch_rest <<-EOF
- ${field_arch_rest}
- EOF
- case "${field_arch_part}" in
- "${match_arch_part}" | 'any') ;;
- *) continue 2;; # Failed match, go to next arch
- esac
- done
+ # "foo-bar-baz" == "any"
+ if [ x"${field_arch}" = x'any' ]; then
return 0
+ fi
+ # "foo-bar-baz" == "foo-any-any"
+ match_arch_rest="${match_arch}"
+ field_arch_rest="${field_arch}"
+ while [ -n "${match_arch_rest}" ] && [ -n "${field_arch_rest}" ]; do
+ IFS='-' read match_arch_part match_arch_rest <<-EOF
+ ${match_arch_rest}
+ EOF
+ IFS='-' read field_arch_part field_arch_rest <<-EOF
+ ${field_arch_rest}
+ EOF
+ case "${field_arch_part}" in
+ "${match_arch_part}" | 'any') ;;
+ *) return 1;; # Failed match
+ esac
done
- # Nothing matched.
- return 1
+ return 0
}
_ob_match_plat()