From: Youngjae Cho Date: Wed, 19 Jun 2024 11:14:01 +0000 (+0900) Subject: tool: hal-compatibility-checker: Add option --reset to remove result file X-Git-Tag: accepted/tizen/unified/20240621.010407^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F58%2F313158%2F3;p=platform%2Fhal%2Fapi%2Fcommon.git tool: hal-compatibility-checker: Add option --reset to remove result file Change-Id: I023148c4534625a073282324e7567b26e54fe5d2 Signed-off-by: Youngjae Cho --- diff --git a/tools/hal-compatibility-checker/main.c b/tools/hal-compatibility-checker/main.c index c4eb3e6..754c0a5 100644 --- a/tools/hal-compatibility-checker/main.c +++ b/tools/hal-compatibility-checker/main.c @@ -44,6 +44,7 @@ enum { OPT_REDIRECT_ALL, OPT_REDIRECT_STDOUT, OPT_REDIRECT_STDERR, + OPT_RESET, OPT_END, }; @@ -63,6 +64,9 @@ static const struct option long_option[] = { [OPT_REDIRECT_STDERR] = { "redirect-stderr", required_argument, NULL, 0 }, + [OPT_RESET] + = { "reset", no_argument, NULL, 0 }, + { 0, }, }; @@ -154,6 +158,9 @@ static void show_help(void) "\n" "\t--redirect-stderr=FILE|dlog\n" "\t\tredirect stderr to FILE or dlog with tag "LOG_TAG_HAL_COMPATIBILITY_CHECKER".\n" + "\n" + "\t--reset\n" + "\t\tremove the existing result file.\n" ); } @@ -163,6 +170,7 @@ int main(int argc, char *argv[]) int help = 0; int index; bool skip_if_result_exist = false; + bool reset_file = false; const char *skip_if_result_exist_dir = NULL; const char *platform_manifest_dir = NULL; const char *outfile = NULL; @@ -194,6 +202,9 @@ int main(int argc, char *argv[]) case OPT_REDIRECT_STDERR: errfile = optarg; break; + case OPT_RESET: + reset_file = true; + break; default: break; } @@ -221,6 +232,11 @@ int main(int argc, char *argv[]) return 0; } + if (reset_file) { + unlink("/opt/etc/hal/.hal-compatibility-checker"); + return 0; + } + for (enum hal_module module = 0; module < HAL_MODULE_END; ++module) { enum hal_common_backend_compatibility compatibility; char module_name[128] = "Unknown";