From 2b85923e0b06f7f633b7f9f18bdec2b16ec5d958 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 26 Oct 2008 18:50:17 +0100 Subject: [PATCH] Minor file checking optimization: set_dir_cache_file. * lib/Automake/FileUtils.pm (set_dir_cache_file): New function. * automake.in (require_file_internal): Instead of resetting the cache when a file has been installed, simply correct the cache using set_dir_cache_file. Signed-off-by: Ralf Wildenhues --- ChangeLog | 6 ++++++ automake.in | 2 +- lib/Automake/FileUtils.pm | 17 ++++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b6a312e7..b173cd503 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-10-26 Ralf Wildenhues + Minor file checking optimization: set_dir_cache_file. + * lib/Automake/FileUtils.pm (set_dir_cache_file): New function. + * automake.in (require_file_internal): Instead of resetting the + cache when a file has been installed, simply correct the cache + using set_dir_cache_file. + No uniquifying for fatal, prog_error, and verbose messages. There is no point in dropping critical messages, even if they are duplicates (unlikely to happen unless they have been sent diff --git a/automake.in b/automake.in index fea09067a..fabeb480d 100755 --- a/automake.in +++ b/automake.in @@ -7387,7 +7387,7 @@ sub require_file_internal ($$$@) $suppress = 0; $trailer = "\n error while copying"; } - reset_dir_cache ($dir); + set_dir_cache_file ($dir, $file); } if (! maybe_push_required_file (dirname ($fullfile), diff --git a/lib/Automake/FileUtils.pm b/lib/Automake/FileUtils.pm index 2200be049..facde3f9a 100644 --- a/lib/Automake/FileUtils.pm +++ b/lib/Automake/FileUtils.pm @@ -47,7 +47,9 @@ use vars qw (@ISA @EXPORT); @EXPORT = qw (&open_quote &contents &find_file &mtime &update_file &up_to_date_p - &xsystem &xsystem_hint &xqx &dir_has_case_matching_file &reset_dir_cache); + &xsystem &xsystem_hint &xqx + &dir_has_case_matching_file &reset_dir_cache + &set_dir_cache_file); =item C @@ -416,6 +418,19 @@ sub reset_dir_cache ($) delete $_directory_cache{$_[0]}; } +=item C + +State that C<$dirname> contains C<$file_name> now. + +=cut + +sub set_dir_cache_file ($$) +{ + my ($dirname, $file_name) = @_; + $_directory_cache{$dirname}{$file_name} = 1 + if exists $_directory_cache{$dirname}; +} + 1; # for require ### Setup "GNU" style for perl-mode and cperl-mode. -- 2.47.2