Description: Invalidate the Autom4te cache more aggressively.
 Upstream only invalidates the Autom4te cache if it is older than
 auto4mte, but this only works well if the autom4te binary date
 reflects the date when it was installed.  In debian, the autom4te
 binary date is instead the date when it was built, which doesn't
 guarantee that caches will be properly invalidated.
 .
 Upstream may be interested, but requested some changes that have not
 yet been made; see the Forwarded: URL.
Forwarded: http://lists.gnu.org/archive/html/autoconf/2006-05/msg00127.html
Bug-Debian: http://bugs.debian.org/219621
Author: Ben Pfaff <pfaffben@debian.org>
Last-Update: 2003-11-10


--- autoconf-2.68.orig/bin/autom4te.in
+++ autoconf-2.68/bin/autom4te.in
@@ -987,7 +1000,8 @@
 # If autom4te is younger, then some structures such as C4che might
 # have changed, which would corrupt its processing.
 Autom4te::C4che->load ($icache_file)
-  if -f $icache && mtime ($icache) > mtime ($0);
+  if -f $icache && mtime ($icache) > mtime ($0)
+                && Autom4te::C4che->good_version ($icache_file);
 
 # Add the new trace requests.
 my $req = Autom4te::C4che->request ('input' => \@ARGV,
--- autoconf-2.68.orig/lib/Autom4te/C4che.pm
+++ autoconf-2.68/lib/Autom4te/C4che.pm
@@ -35,6 +35,8 @@
 use Carp;
 use strict;
 
+my $VERSION = '#substituted by debian/rules#';
+
 =over 4
 
 =item @request
@@ -180,7 +182,7 @@
   $file->seek (0, 0);
   $file->truncate (0);
   print $file
-    "# This file was generated.\n",
+    "# This file was generated by Autom4te $VERSION.\n",
     "# It contains the lists of macros which have been traced.\n",
     "# It can be safely removed.\n",
     "\n",
@@ -194,6 +196,16 @@
 
 =cut
 
+#
+# GOOD_VERSION ($FILE)
+sub good_version ($$)
+{
+  my ($self, $file) = @_;
+  my ($line) = $file->getline;
+
+  return defined ($line) && scalar ($line =~ / $VERSION.$/);
+}
+
 # LOAD ($FILE)
 # ------------
 sub load ($$)
