From: Joey Hess <joey@kitenet.net>
Date: Sun, 30 Dec 2007 19:49:25 +0000 (-0500)
Subject: * aggregate: Fix stupid mistake introduced when converting it to use
X-Git-Tag: 2.17~3
X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/f0f52e602df1e681aa6ce18fa3976120a6c5cb56

* aggregate: Fix stupid mistake introduced when converting it to use
  the needsbuild hook. This resulted in feeds not being removed when pages
  were updated, and probably other bugs.
* aggregate: Avoid uninitialised value warning when removing a feed that
  has an expired guid.
---

diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index 68ff6a616..13c697dcc 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -54,11 +54,11 @@ sub needsbuild (@) { #{{{
 	
 	loadstate(); # if not already loaded
 
-	foreach my $page (keys %pagestate) {
-		if (grep { $_ eq $pagesources{$page} } @$needsbuild) {
+	foreach my $feed (values %feeds) {
+		if (grep { $_ eq $pagesources{$feed->{sourcepage}} } @$needsbuild) {
 			# Mark all feeds originating on this page as removable;
 			# preprocess will unmark those that still exist.
-			remove_feeds($page);
+			remove_feeds($feed->{sourcepage});
 		}
 	}
 } # }}}
@@ -182,7 +182,8 @@ sub savestate () { #{{{
 				}
 			}
 			else {
-				unlink pagefile($data->{page});
+				unlink pagefile($data->{page})
+					if exists $data->{page};
 			}
 			next;
 		}
diff --git a/debian/changelog b/debian/changelog
index 71119b3f5..b908d7abe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,11 @@ ikiwiki (2.17) UNRELEASED; urgency=low
     and supporting negated pagespecs and added whitespace.
   * map: Fix handling of common prefix to handle the case where it's
     in a subdirectory. Patch by Larry Clapp.
+  * aggregate: Fix stupid mistake introduced when converting it to use
+    the needsbuild hook. This resulted in feeds not being removed when pages
+    were updated, and probably other bugs.
+  * aggregate: Avoid uninitialised value warning when removing a feed that
+    has an expired guid.
 
  -- Joey Hess <joeyh@debian.org>  Wed, 19 Dec 2007 16:39:07 -0500
 
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index a9102965f..59c06cdf1 100644
--- a/po/ikiwiki.pot
+++ b/po/ikiwiki.pot
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-12-27 19:28-0500\n"
+"POT-Creation-Date: 2007-12-30 14:16-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"