]> Kevux Git Server - fll/commitdiff
Bugfix: Do not validate directory existence when cleaning.
authorKevin Day <thekevinday@gmail.com>
Tue, 15 Feb 2022 18:09:42 +0000 (12:09 -0600)
committerKevin Day <thekevinday@gmail.com>
Tue, 15 Feb 2022 18:12:25 +0000 (12:12 -0600)
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
level_3/fake/c/private-clean.c

index f3a33decf85439bddc6329f1d48dacf01be33273..d32016f0f6a7b574b26db1d414c93874211224ef 100644 (file)
@@ -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;
           }
 
index 1e44e115e5590c546f273c76f3f4536adf8eaecb..b03359c09b189673e112ba178ddd7144622ee517 100644 (file)
@@ -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;