From 01e3ee8e47b63c4c4e03d22dabdccfd7c17e1ceb Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 29 Sep 2012 22:49:33 -0400 Subject: Simplify wildcard matching in ob_match_arch(). --- diff --git a/lib/metadata.sh b/lib/metadata.sh index 687d96a..b33fd0e 100644 --- a/lib/metadata.sh +++ b/lib/metadata.sh @@ -170,25 +170,15 @@ ob_match_arch() return ${?} fi - # Compile patterns to match hyphenated architectures. - _obma_a_pat_norm="$(echo "${_obma_a}" | \ - sed 's/^any-/*-/;s/-any-/-*-/g;s/-any$/-*/g')" - _obma_a_pat_hyph="$(echo "${_obma_a}" | \ - sed 's/^any-/*-*-/;s/-any-/-*-*-/g;s/-any$/-*-*/g')" + # Generate an ERE to match hyphenated architectures. + _obma_a_ere="$(echo "${_obma_a}" | \ + sed 's/^any-/[^-]+-/;s/-any-/-[^-]+-/g;s/-any$/-[^-]+/g')" # "foo-bar-baz" == "foo-any-any" - case "${_obma_arch}" in - ${_obma_a_pat_hyph}) - continue - ;; - ${_obma_a_pat_norm}) - _ob_return 0 - return ${?} - ;; - *) - continue - ;; - esac + if echo "${_obma_arch}" | grep -R "${_obma_a_ere}"; then + _ob_return 0 + return ${?} + fi done -- cgit v0.9.1