* A patch to make TemplateToolkit work properly on templates in the

Nix store.

svn path=/nixpkgs/trunk/; revision=13491
This commit is contained in:
Eelco Dolstra
2008-11-28 16:10:32 +00:00
parent 3189f877d0
commit 85fa8661e3
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
diff -rc Template-Toolkit-2.20-orig/lib/Template/Provider.pm Template-Toolkit-2.20/lib/Template/Provider.pm
*** Template-Toolkit-2.20-orig/lib/Template/Provider.pm 2008-08-06 11:32:02.000000000 +0200
--- Template-Toolkit-2.20/lib/Template/Provider.pm 2008-11-28 16:37:36.000000000 +0100
***************
*** 936,942 ****
sub _template_modified {
my $self = shift;
my $template = shift || return;
! return (stat( $template ))[9];
}
#------------------------------------------------------------------------
--- 936,945 ----
sub _template_modified {
my $self = shift;
my $template = shift || return;
! # Nix specific hack: timestamps of 0 (1-1-1970) should not be
! # treated as undefined, so return 1 instead.
! my $t = (stat( $template ))[9];
! return (defined $t && $t == 0) ? 1 : $t;
}
#------------------------------------------------------------------------