# HG changeset patch # User Heiko Schlittermann # Date 1452348065 -3600 # Node ID 1d82a68eb0a31f604fa07ce48e75ab478065b052 # Parent 7903028768ed8d6bd6931f89f0aac56dec44eef5 PRE_PROCESS the version.tt automatically. Hui, the Template Toolkit does not find files with an mtime @0 (begin of the epoch.) I had hard times to figure it out. diff -r 7903028768ed -r 1d82a68eb0a3 bin/once --- a/bin/once Mon Jan 04 15:16:55 2016 +0100 +++ b/bin/once Sat Jan 09 15:01:05 2016 +0100 @@ -68,7 +68,7 @@ my $rxFILE = qr/[a-z\d]{6}-[a-z\d]+-[dme]/i; # date-filehash-removalmode my %TT_CONFIG = ( -# PROCESS => 'version.tt', + PRE_PROCESS => 'version.tt', INCLUDE_PATH => [ (map { catfile($Bin, $_) } qw(templates templates.default) ), #(map { catfile(dist_dir($DIST), $_) } qw(var templates.override templates)), diff -r 7903028768ed -r 1d82a68eb0a3 lib/version.PL --- a/lib/version.PL Mon Jan 04 15:16:55 2016 +0100 +++ b/lib/version.PL Sat Jan 09 15:01:05 2016 +0100 @@ -9,8 +9,12 @@ } print <<_; -[%# autogenerated at $now by $0 %] -[% vcs.version = "$version"; %] +[% # autogenerated at $now by $0 + # included automatically via PRE_PROCESS + vcs.version = "$version"; +-%] _ -utime 0, 0 => $outfile +# zero timestamp does not work! Template/tpage will +# complain about "file not found" +utime 1, 1 => $outfile diff -r 7903028768ed -r 1d82a68eb0a3 templates/once.tt --- a/templates/once.tt Mon Jan 04 15:16:55 2016 +0100 +++ b/templates/once.tt Sat Jan 09 15:01:05 2016 +0100 @@ -2,7 +2,7 @@ [%- - USE date; + USE date; # for date formattting in inventory.html -%] Once @@ -22,4 +22,6 @@ -[%# vim:ft=html: %] +[% + # vim:ft=html: +%]