From: Joey Hess Date: Fri, 23 Apr 2010 20:41:07 +0000 (-0400) Subject: special case for page.tmpl dependency handling X-Git-Tag: 3.20100427~39 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6486452e4c94f5699d98d13e25a361435ed3ddeb;p=ikiwiki.git special case for page.tmpl dependency handling Rather than wasting resources recording that every page depends on page.tmpl, add a special case. The special case curretly rebuilds non-page files too when page.tmpl changes, but that's minor. --- diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 7cf19645e..8ae0cbd4f 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -74,9 +74,16 @@ sub genpage ($$) { $templatefile=$file; } }); - my $template=template_depends( - defined $templatefile ? $templatefile : 'page.tmpl', $page, - blind_cache => 1); + my $template; + if (defined $templatefile) { + $template=template_depends($templatefile, $page, + blind_cache => 1); + } + else { + # no explicit depends as special case + $template=template('page.tmpl', + blind_cache => 1); + } my $actions=0; if (length $config{cgiurl}) { @@ -763,8 +770,14 @@ sub refresh () { foreach my $file (@$new, @$del) { render_linkers($file); } - - if (@$changed || @$internal_changed || + + if ($rendered{"templates/page.tmpl"}) { + foreach my $f (@$files) { + next if $f eq "templates/page.tmpl"; + render($f, sprintf(gettext("building %s, which depends on %s"), $f, "templates/page.tmpl")); + } + } + elsif (@$changed || @$internal_changed || @$del || @$internal_del || @$internal_new) { 1 while render_dependent($files, $new, $internal_new, $del, $internal_del, $internal_changed,