]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Minor file checking optimization: set_dir_cache_file.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 26 Oct 2008 17:50:17 +0000 (18:50 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 26 Oct 2008 17:50:17 +0000 (18:50 +0100)
* 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 <Ralf.Wildenhues@gmx.de>
ChangeLog
automake.in
lib/Automake/FileUtils.pm

index 9b6a312e7af1396a8a7f042def516f212639a6c9..b173cd50394b17ec5dbc24867eda3486e844e4ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-10-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       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
index fea09067aacb33bd235063f1f112ef26e6d40e63..fabeb480dfdf545f9a039463f568d1aeea0e76ea 100755 (executable)
@@ -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),
index 2200be0499ba184d09a5fab212f4d5765ba1fc73..facde3f9a8d36eaef55696af3710201ed1ed7fda 100644 (file)
@@ -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<open_quote ($file_name)>
@@ -416,6 +418,19 @@ sub reset_dir_cache ($)
   delete $_directory_cache{$_[0]};
 }
 
+=item C<set_dir_cache_file ($dirname, $file_name)>
+
+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.