diff options
author | Joey Hess <joey@kitenet.net> | 2010-04-22 00:12:15 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-04-22 00:18:20 -0400 |
commit | 2b175d7c1fe997277800c0d501332e96de475c6d (patch) | |
tree | e022416ed318e339e5ce5b39f9f4037e71afdd14 /IkiWiki.pm | |
parent | bc6d6026093ae6f2bfd72a2c06887358a0e59b6b (diff) | |
download | ikiwiki-2b175d7c1fe997277800c0d501332e96de475c6d.tar ikiwiki-2b175d7c1fe997277800c0d501332e96de475c6d.tar.gz |
improved fix for depends_simple_mixup
Avoid adding the page matched against as an influence for
currently failing pagespec matches, while still adding
any other influences.
This avoids bloating depends_simple with lots of bogus influences when
matching eg, "!link(done)". It's only necessary for the page being tested
to be an influence of that if the page matches.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 0791e1e75..509f9ba2e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1818,10 +1818,12 @@ sub add_depends ($$;$) { foreach my $p (keys %pagesources) { my $r=$sub->($p, location => $page); my $i=$r->influences; + my $static=$r->influences_static; foreach my $k (keys %$i) { + next unless $r || $static || $k eq $page; $depends_simple{$page}{lc $k} |= $i->{$k}; } - last if $r->influences_static; + last if $static; } $depends{$page}{$pagespec} |= $deptype; @@ -2136,6 +2138,9 @@ sub pagespec_match_list ($$;@) { my $r=$sub->($p, %params, location => $page); error(sprintf(gettext("cannot match pages: %s"), $r)) if $r->isa("IkiWiki::ErrorReason"); + unless ($r) { + $r->remove_influence($p); + } $accum |= $r; if ($r) { push @matches, $p; @@ -2232,6 +2237,13 @@ sub merge_influences { } } +sub remove_influence { + my $this=shift; + my $torm=shift; + + delete $this->[1]{$torm}; +} + package IkiWiki::ErrorReason; our @ISA = 'IkiWiki::FailReason'; |