From af2220f5f8b72b6a97788270bd46ebeb6f3ff881 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Tue, 8 Dec 2020 11:54:39 +0800 Subject: [PATCH] find_apps.py: app with no supported targets will be skipped correctly - fix deprecated logging.warn() --- tools/find_apps.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/find_apps.py b/tools/find_apps.py index 6fdaf178f7..f4bdf04d0d 100755 --- a/tools/find_apps.py +++ b/tools/find_apps.py @@ -146,9 +146,9 @@ def find_apps(build_system_class, path, recursive, exclude_list, target): logging.debug("Looking for {} apps in {}{}".format(build_system_name, path, " recursively" if recursive else "")) if not recursive: if exclude_list: - logging.warn("--exclude option is ignored when used without --recursive") + logging.warning("--exclude option is ignored when used without --recursive") if not build_system_class.is_app(path): - logging.warn("Path {} specified without --recursive flag, but no {} app found there".format( + logging.warning("Path {} specified without --recursive flag, but no {} app found there".format( path, build_system_name)) return [] return [path] @@ -168,12 +168,15 @@ def find_apps(build_system_class, path, recursive, exclude_list, target): del dirs[:] supported_targets = build_system_class.supported_targets(root) - if supported_targets and target not in supported_targets: - logging.debug("Skipping, app only supports targets: " + ", ".join(supported_targets)) + if supported_targets and (target in supported_targets): + apps_found.append(root) + else: + if supported_targets: + logging.debug("Skipping, app only supports targets: " + ", ".join(supported_targets)) + else: + logging.debug("Skipping, app has no supported targets") continue - apps_found.append(root) - return apps_found