commit:     595a73259025589c65af837ce23d994523242d45
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Wed May 10 00:35:13 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 11 01:24:41 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=595a7325

install-qa-check.d/90config-impl-decl: Allow wildcards in 
QA_CONFIG_IMPL_DECL_SKIP

This will enable us to ignore all __builtin_* functions, for example.

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/install-qa-check.d/90config-impl-decl | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/bin/install-qa-check.d/90config-impl-decl 
b/bin/install-qa-check.d/90config-impl-decl
index 0e758e87d..7eb7dcff9 100644
--- a/bin/install-qa-check.d/90config-impl-decl
+++ b/bin/install-qa-check.d/90config-impl-decl
@@ -19,6 +19,18 @@
 #
 # See also: bug 892651
 
+# Same as the "has" function, but allows wildcards in the array
+is_in() {
+       local needle=$1
+       shift
+
+       local x
+       for x in "$@"; do
+               [[ "${needle}" = ${x} ]] && return 0
+       done
+       return 1
+}
+
 find_log_targets() {
        local log_targets=(
                'config.log'
@@ -80,7 +92,7 @@ config_impl_decl_check() {
                                continue
                        fi
 
-                       has "${func}" "${QA_CONFIG_IMPL_DECL_SKIP[@]}" && 
continue
+                       is_in "${func}" "${QA_CONFIG_IMPL_DECL_SKIP[@]}" && 
continue
 
                        files+=( "${l}" )
                        lines+=( "${line}" )

Reply via email to