From 93b676eaed35219a763e443b72daa25cae0565cf Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 15 Feb 2022 12:09:42 -0600 Subject: [PATCH] Bugfix: Do not validate directory existence when cleaning. Do not call the directory validation existence check before cleaning. Also treat F_directory as not an error when cleaning. Remove unnecessary signal check. Output to warning stream instead of normal output stream when displaying warning. --- level_3/fake/c/fake.c | 1 - level_3/fake/c/private-clean.c | 18 +++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index f3a33de..d32016f 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -309,7 +309,6 @@ extern "C" { } else if (main->operation == fake_operation_clean_e) { if (validate_parameter_directories) { - status = fake_validate_parameter_directories(main); validate_parameter_directories = F_false; } diff --git a/level_3/fake/c/private-clean.c b/level_3/fake/c/private-clean.c index 1e44e11..b03359c 100644 --- a/level_3/fake/c/private-clean.c +++ b/level_3/fake/c/private-clean.c @@ -13,8 +13,6 @@ extern "C" { #ifndef _di_fake_clean_operate_ f_status_t fake_clean_operate(fake_main_t * const main) { - f_status_t status = F_none; - if (main->output.verbosity != f_console_verbosity_quiet_e) { flockfile(main->output.to.stream); @@ -25,9 +23,7 @@ extern "C" { funlockfile(main->output.to.stream); } - if (fake_signal_received(main)) { - return F_status_set_error(F_interrupt); - } + f_status_t status = F_none; if (main->error.verbosity == f_console_verbosity_verbose_e) { status = f_directory_remove_custom(main->path_build, F_directory_descriptors_max_d, F_true, fake_clean_remove_recursively_verbosely); @@ -36,15 +32,15 @@ extern "C" { status = f_directory_remove(main->path_build, F_directory_descriptors_max_d, F_true); } - if (F_status_set_fine(status) == F_file_found_not) { + if (F_status_set_fine(status) == F_file_found_not || F_status_set_fine(status) == F_directory) { if (main->error.verbosity == f_console_verbosity_verbose_e) { - flockfile(main->output.to.stream); + flockfile(main->warning.to.stream); - f_print_terminated("The build directory '", main->output.to.stream); - fl_print_format("%[%Q%]", main->output.to.stream, main->context.set.notable, main->path_build, main->context.set.notable); - fl_print_format("' does not exist.%r", main->output.to.stream, f_string_eol_s); + f_print_terminated("The build directory '", main->warning.to.stream); + fl_print_format("%[%Q%]", main->warning.to.stream, main->context.set.notable, main->path_build, main->context.set.notable); + fl_print_format("' does not exist.%r", main->warning.to.stream, f_string_eol_s); - funlockfile(main->output.to.stream); + funlockfile(main->warning.to.stream); } status = F_none; -- 1.8.3.1