[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[PATCH] Fix mktables time stamp test



Fix time stamp test for recompiling Unicode tables in mktables

mktables has a reversed test for deciding whether a file had been 
changed recently so it would know if to recompile or not.  I'm guessing 
that this mistake was made was because the variables that held the 
values were misleadingly named, so I changed their names.

I can't help but wonder if the reason that Makefile.SH calls mktables 
with the -w option to always recompile is a result of not knowing about 
this bug and trying to get things to work.  The commit message for when 
this happened says
"Change 22963 by davem@davem-percy on 2004/06/20 12:00:56

make mktables always update modifed time to play better with make"

Compiles of perl would be sped up if this were removed.  I've done that 
in my local copy.  Let me know if you want me to submit a patch for that.

I also fixed a typo in a comment
From 49e669fb23b478943564bb9b9e1523f74638946c Mon Sep 17 00:00:00 2001
From: Karl <khw@karl.(none)>
Date: Mon, 19 Jan 2009 11:09:58 -0700
Subject: [PATCH] Fix whether to recompile times

---
 lib/unicore/mktables |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index 41c206c..fb951a6 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -102,18 +102,18 @@ if ($FileList) {
         print "Expecting ".scalar( @input )." input files. ",
               "Checking ".scalar( @output )." output files.\n";
     }
-    # we set maxtime to be the youngest input file, including $0 itself.
-    my $maxtime = -M $0; # do this before the chdir!
+    # we set $youngest to be the youngest input file, including $0 itself.
+    my $youngest = -M $0; # do this before the chdir!
     if ($UseDir) {
         chdir $UseDir or die "Failed to chdir to '$UseDir':$!";
     }
     foreach my $in (@input) {
-        my $time = -M $in;
-        die "Missing input file '$in'" unless defined $time;
-        $maxtime = $time if $maxtime < $time;
+        my $age = -M $in;
+        die "Missing input file '$in'" unless defined $age;
+        $youngest = $age if $age < $youngest;
     }
 
-    # now we check to see if any output files are older than maxtime, if
+    # now we check to see if any output files are older than youngest, if
     # they are we need to continue on, otherwise we can presumably bail.
     my $ok = 1;
     foreach my $out (@output) {
@@ -123,7 +123,7 @@ if ($FileList) {
             $ok = 0;
             last;
         }
-        if ( -M $out > $maxtime ) {
+        if ( -M $out > $youngest ) {
             print "'$out' is too old.\n"
                 if $Verbose;
             $ok = 0;
@@ -505,7 +505,7 @@ sub Table::Append
 
 ##
 ## Given a code point range starting value and ending value (and name),
-## Add the range to teh Table.
+## Add the range to the Table.
 ##
 ## NOTE: Code points must be added in strictly ascending numeric order.
 ##
-- 
1.5.4.3


Follow-Ups from:
demerphq <demerphq@gmail.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]