summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-03-21 14:42:59 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-03-21 14:42:59 -0400
commit5d9ed614db889116421be0f24edc14b198c1e18d (patch)
treec955f761ac851c023fa3ebd69235c59b36c9e483
parente3866fd94f31a656dddd78dd3f8750628264e9d3 (diff)
fix page source storing
This saves space, and stores the data under the right keys.
-rw-r--r--IkiWiki.pm15
1 files 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};
}
}
}