Recompute the watch list, rebuild fingerprints, and print/log the result.
Called:
- During initialization,
- When the manifest changes,
- Periodically when rescan > 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(watcher_t), | intent(inout) | :: | self | |||
| logical, | intent(in) | :: | print_header |
subroutine rebuild_watch_list(self, print_header) class(watcher_t), intent(inout) :: self logical, intent(in) :: print_header integer(int64) :: rate, t0, t1 real :: build_secs_total real :: secs_model, secs_targets, secs_watch integer :: nfiles, nroots real :: dummy_build type(string_t), allocatable :: new_files(:) integer(int64), allocatable :: new_mask(:) type(root_info_t), allocatable :: new_roots(:) call system_clock(count_rate=rate) if (rate <= 0_int64) rate = 1000_int64 call system_clock(t0) call compute_watch_files_from_settings( & settings = self%cfg%settings, & w = self%cfg%w, & files = new_files, & file_mask = new_mask, & roots = new_roots, & manifest_key = self%man_prev, & build_secs = dummy_build, & secs_model = secs_model, & secs_targets = secs_targets, & secs_watch = secs_watch ) call move_alloc(new_files, self%files) call move_alloc(new_mask, self%file_mask) call move_alloc(new_roots, self%roots) call self%fm%on_watch_list_built_all(self%files, self%roots) self%man_prev = manifest_key_from_files(self%cfg%settings, self%files) call init_fingerprints(self%files, self%fp_prev, self%fp_now, self%changed_idx) call system_clock(t1) build_secs_total = real(t1 - t0) / real(rate) nfiles = 0 if (allocated(self%files)) nfiles = size(self%files) nroots = 0 if (allocated(self%roots)) nroots = size(self%roots) if (self%cfg%w%debug) then call log_info(self%cfg%w, "debug: manifest_key=" // str(self%man_prev)) call log_info(self%cfg%w, "debug: roots=" // str(nroots) // " files=" // str(nfiles)) end if if (print_header) then call print_banner( & full_cmdline = self%cfg%fpm_cmdline, & settings = self%cfg%settings, & w = self%cfg%w, & files = self%files, & build_secs = build_secs_total, & roots_count = nroots, & secs_model = secs_model, & secs_targets = secs_targets, & secs_watch = secs_watch ) if (self%cfg%w%print_files_once) call print_file_list(self%files, self%cfg%w) else call log_info(self%cfg%w, "watch list updated in " // ftoa(build_secs_total) // "s; files=" // str(nfiles)) if (self%cfg%w%verbosity >= 2) call print_file_list(self%files, self%cfg%w) end if end subroutine rebuild_watch_list