From 5d9ed614db889116421be0f24edc14b198c1e18d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 21 Mar 2008 14:42:59 -0400 Subject: [PATCH] fix page source storing This saves space, and stores the data under the right keys. --- IkiWiki.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 2fad45c38..684713821 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -914,12 +914,13 @@ sub loadindex () { #{{{ return 0; } my %index=%$ret; - foreach my $page (keys %index) { - my %d=%{$index{$page}}; + foreach my $src (keys %index) { + my %d=%{$index{$src}}; + my $page=pagename($src); $pagectime{$page}=$d{ctime}; if (! $config{rebuild}) { + $pagesources{$page}=$src; $pagemtime{$page}=$d{mtime}; - $pagesources{$page}=$d{src}; $renderedfiles{$page}=$d{dest}; if (exists $d{links} && ref $d{links}) { $links{$page}=$d{links}; @@ -961,23 +962,23 @@ sub saveindex () { #{{{ my %index; foreach my $page (keys %pagemtime) { next unless $pagemtime{$page}; + my $src=$pagesources{$page}; - $index{$page}={ + $index{$src}={ ctime => $pagectime{$page}, mtime => $pagemtime{$page}, - src => $pagesources{$page}, dest => $renderedfiles{$page}, links => $links{$page}, }; if (exists $depends{$page}) { - $index{$page}{depends} = $depends{$page}; + $index{$src}{depends} = $depends{$page}; } if (exists $pagestate{$page}) { foreach my $id (@hookids) { foreach my $key (keys %{$pagestate{$page}{$id}}) { - $index{$page}{state}{$id}{$key}=$pagestate{$page}{$id}{$key}; + $index{$src}{state}{$id}{$key}=$pagestate{$page}{$id}{$key}; } } } -- 2.26.2