[Templates] compilied cache versions

Josh Rosenbaum josh@infogears.com
Fri, 11 May 2007 10:00:58 -0600


Bill Moseley wrote:
> On Thu, May 10, 2007 at 09:59:02PM -0700, Bill Moseley wrote:
>> On Thu, May 10, 2007 at 05:49:06PM +0100, Travis Basevi wrote:
>>> Ignoring the task of fixing the faults (and faulty people) in our setup, 
>>> is there a reason why the .ttc version only updates if the .tt2 has a 
>>> newer mtime? As far as I can tell, the guilty code is the following in 
>>> Provider.pm,v 2.88:
>>>
>>>                 if ($compiled && -f $compiled
>>>                     && (stat($path))[9] <= (stat($compiled))[9]) {
>>>
>>> Assuming the .ttc is always set to the mtime of the .tt2 (can't find the 
>>> code that does this, but observations suggest this), could the <= 
>>> instead be changed to == thus ensuring the compiled version has to match 
>>> (or at least have the same mtime) as the tt2 file?
>> IIRC that change is not in the current version on CPAN.
>                       ^^^
> 
> I seem to have developed this typing problem where I type "not" when I
> mean "now".  Kind of changes the meaning.
> 

Good call Bill. It appears you are right.

http://search.cpan.org/src/ABW/Template-Toolkit-2.19/lib/Template/Provider.pm

It looks like the routine is named "_compiled_is_current" where this is done now.

-- Josh