Fixing progress type on diagnosing extra files

When dealing with extra files during a "verify" action, we cannot really
tell how far in the process we are, so we should be defining that step
as PROGRESS_UNDEFINED. Since we are using a PROGRESS_BAR, it is causing
to show an extra "[100%]" at the end of the diagnose process.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit is contained in:
Castulo Martinez
2020-04-16 12:54:45 -07:00
committed by Castulo J. Martinez
parent 77642ec291
commit 056137fd4a
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -836,6 +836,7 @@ static enum swupd_code deal_with_extra_files(struct manifest *manifest, bool fix
info("%s extra files under %s\n", fix ? "Removing" : "Checking for", start);
ret = walk_tree(manifest, start, fix, picky_whitelist, &counts);
free_and_clear_pointer(&start);
info("\n");
return ret;
}
@@ -1243,7 +1244,7 @@ enum swupd_code execute_verify_extra(extra_proc_fn_t post_verify_fn)
extra_files:
if (cmdline_option_picky || cmdline_option_extra_files_only) {
timelist_timer_start(globals.global_times, "Removing extra files");
progress_next_step("remove_extra_files", PROGRESS_BAR);
progress_next_step("remove_extra_files", PROGRESS_UNDEFINED);
deal_with_extra_files(official_manifest, cmdline_option_fix);
timelist_timer_stop(globals.global_times);
}
+1 -1
View File
@@ -137,7 +137,7 @@ test_setup() {
{ "type" : "progress", "currentStep" : 8, "totalSteps" : 10, "stepCompletion" : 88, "stepDescription" : "remove_extraneous_files" },
{ "type" : "progress", "currentStep" : 8, "totalSteps" : 10, "stepCompletion" : 94, "stepDescription" : "remove_extraneous_files" },
{ "type" : "progress", "currentStep" : 8, "totalSteps" : 10, "stepCompletion" : 100, "stepDescription" : "remove_extraneous_files" },
{ "type" : "progress", "currentStep" : 9, "totalSteps" : 10, "stepCompletion" : 0, "stepDescription" : "remove_extra_files" },
{ "type" : "progress", "currentStep" : 9, "totalSteps" : 10, "stepCompletion" : -1, "stepDescription" : "remove_extra_files" },
{ "type" : "info", "msg" : "Removing extra files under $PATH_PREFIX/usr" },
{ "type" : "info", "msg" : " -> Extra file: $PATH_PREFIX/usr/share/defaults/swupd/versionurl" },
{ "type" : "info", "msg" : " -> deleted" },