From: Joey Hess <joey@kitenet.net>
Date: Fri, 23 Jul 2010 18:14:25 +0000 (-0400)
Subject: template: Fix dependency tracking. Broken in version 3.20100427.
X-Git-Tag: 3.20100804~35
X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/1b0bef6d49722d37eca3e871e808e46b2a1461a3?ds=inline;hp=--cc

template: Fix dependency tracking. Broken in version 3.20100427.

template_depends was adding a dependency on the source filename,
instead of on the page name when a template is a page. Such a
dependency doesn't work.
---

1b0bef6d49722d37eca3e871e808e46b2a1461a3
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 0c0b7bd4c..cfa4f5f03 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1730,12 +1730,15 @@ sub template_file ($) {
 	my $name=shift;
 	
 	my $tpage=($name =~ s/^\///) ? $name : "templates/$name";
+	my $template;
 	if ($name !~ /\.tmpl$/ && exists $pagesources{$tpage}) {
-		$tpage=$pagesources{$tpage};
+		$template=srcfile($pagesources{$tpage}, 1);
 		$name.=".tmpl";
 	}
+	else {
+		$template=srcfile($tpage, 1);
+	}
 
-	my $template=srcfile($tpage, 1);
 	if (defined $template) {
 		return $template, $tpage, 1 if wantarray;
 		return $template;
diff --git a/debian/changelog b/debian/changelog
index 209b170eb..c27af5615 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ikiwiki (3.20100723) UNRELEASED; urgency=low
+
+  * template: Fix dependency tracking. Broken in version 3.20100427.
+
+ -- Joey Hess <joeyh@debian.org>  Fri, 23 Jul 2010 14:00:32 -0400
+
 ikiwiki (3.20100722) unstable; urgency=low
 
   * img: Add a margin around images displayed by this directive.