diff options
author | Karl Berry <karl@freefriends.org> | 2006-02-14 23:18:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-02-14 23:18:51 +0000 |
commit | 977bb337c09c09f6b5e8bfb8c701bd4a2d5cfd5e (patch) | |
tree | 69bef75efb5458b61518df3039e32803ae76ec47 /Build/tools/Tpm.pm | |
parent | d91f845a970d4b1e9dd3b5d9c29dedffd9a10c66 (diff) |
(fixDate): get binary file list and use it;
previously not really checking binaries.
(debug_date): new fn.
git-svn-id: svn://tug.org/texlive/trunk@1535 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/tools/Tpm.pm')
-rw-r--r-- | Build/tools/Tpm.pm | 57 |
1 files changed, 36 insertions, 21 deletions
diff --git a/Build/tools/Tpm.pm b/Build/tools/Tpm.pm index 02058900869..2944702c230 100644 --- a/Build/tools/Tpm.pm +++ b/Build/tools/Tpm.pm @@ -588,7 +588,9 @@ sub getFileList { foreach $v (@{$self->{$n}}) { if (($CurrentArch eq "all" && FileUtils::member(${$v}{"arch"}, @Tpm::ArchList)) || ${$v}{"arch"} eq ${CurrentArch}) { - push @l, @{${$v}{"text"}}; + my @val = @{${$v}{"text"}}; + #print "getfilelist pushing for $v: @val\n"; + push @l, @val; } } } @@ -602,7 +604,8 @@ sub getFileList { if (wantarray) { #print "getfilelist($n) returning list: @l\n"; - #&debug_hash ("$n", $self->{$n}); + #&debug_hash ($n, $self->{$n}); + #print "$n {text} = " . @{$n{text}} . "\n"; return @l; } else { @@ -1014,58 +1017,70 @@ sub printdate { return &formatdate(@mytime); } +sub debug_date +{ + my ($str,$date) = @_; + #warn "$str " . &formatdate(gmtime($date)) . "\n"; +} + # if any of FILES are newer than OLDDATE, return the newest mtime. # sub max_date { my ($olddate, @files) = @_; - my ($f, $tpmdate); - #print " olddate was " . &formatdate(gmtime($oldate)) . ", files=@files\n"; - foreach $f (@files) { + my $tpmdate = 0; + &debug_date (" max_date files=@files, olddate=", $olddate); + for my $f (@files) { # although the texmf/tpm/*.tpm files are mostly hand-maintained, it # still seems best for the TPM:Date to reflect the newest date of # the actual files in the package; the sizes and such might still # get autoupdated. if ($f =~ m,/tpm/.*\.tpm$,) { $tpmdate = (stat("$MasterDir/$f"))[9]; - #print " tpm itself, found " . &formatdate(gmtime($tpmdate)) . "\n"; + &debug_date (" tpm itself, found ", $tpmdate); } - else { + elsif (-f "$MasterDir/$f") { my @st = stat("$MasterDir/$f"); - #print " file $f is " . &formatdate(gmtime($st[9])) . "\n"; + &debug_date (" file $f is ", $st[9]); if ($st[9] > $olddate) { - #print " replacing\n"; + &debug_date (" replacing olddate ", $olddate); $olddate = $st[9]; } } } - if ($olddate == 0) { + if ($olddate == 0 && $tpmdate) { + &debug_date (" max_date using tpm date", $tpmdate); $olddate = $tpmdate; } - #print " max_date returning " . &formatdate(gmtime($olddate)) . "\n"; + &debug_date (" max_date returning ", $olddate); return $olddate; } sub fixDate { my ($self) = @_; my $newdate = 0; - foreach my $s (@{$self->getFileList("BinFiles")}) { - if ($CurrentArch eq "all" || $s =~ m@/${CurrentArch}/@) { - $newdate = &max_date($newdate, ${$s}{"text"}); - } - } - #print " newdate after bin: " . &formatdate(gmtime($newdate)) . "\n"; + my @binfiles = $self->getFileList("BinFiles"); + #warn "binfiles=@binfiles"; + if ($CurrentArch ne "all") { + @binfiles = grep { m@/${CurrentArch}/@ } @binfiles; + warn "arch-filtered for $CurrentArch binfiles=@binfiles"; + } + $newdate = &max_date($newdate, @binfiles); + &debug_date (" newdate after bin: ", $newdate); + # $newdate = &max_date($newdate, $self->getFileList("DocFiles")); - #print " newdate after doc: " . &formatdate(gmtime($newdate)) . "\n"; + &debug_date (" newdate after doc: ", $newdate); + # $newdate = &max_date($newdate, $self->getFileList("SourceFiles")); - #print " newdate after source: " . &formatdate(gmtime($newdate)) . "\n"; + &debug_date (" newdate after source: " , $newdate); + # $newdate = &max_date($newdate, $self->getFileList("RemoteFiles")); - #print " newdate after remote: " . &formatdate(gmtime($newdate)) . "\n"; + &debug_date (" newdate after remote: " , $newdate); # # Check the RunFiles last, because it includes the tpm itself, and we # only want to use that as a last resort. $rundate = &max_date($newdate, $self->getFileList("RunFiles")); - #print " newdate after run: " . &formatdate(gmtime($newdate)) . "\n"; + &debug_date (" newdate after run: ", $newdate); $self->setAttribute("Date", &formatdate(gmtime($newdate))); } |