diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-10-04 20:30:21 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-10-04 20:30:21 -0400 |
commit | be032a7b87d1080f1a54327346cb5b40432a056c (patch) | |
tree | d945e47c53ca110840491d8fe2cd96515ae5dfe3 /IkiWiki/Render.pm | |
parent | b4c8cc90726cb953898b14f378881bddd224a22c (diff) |
rework dependency types code
Simplify, change default content depends number to 1,
change interface to make more sense.
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r-- | IkiWiki/Render.pm | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 3fc750925..cf0c3fe08 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -473,13 +473,11 @@ sub refresh () { if (exists $depends_simple{$p}) { foreach my $d (keys %{$depends_simple{$p}}) { - if ($depends_simple{$p}{$d} == $IkiWiki::DEPEND_EXISTS) { - if (exists $lc_exists_changed{$d}) { - $reason = $d; - last; - } - } - elsif (exists $lc_changed{$d}) { + if (($depends_simple{$p}{$d} & $IkiWiki::DEPEND_CONTENT && + exists $lc_changed{$d}) + || + ($depends_simple{$p}{$d} & $IkiWiki::DEPEND_PRESENCE && + exists $lc_exists_changed{$d})) { $reason = $d; last; } @@ -492,22 +490,22 @@ sub refresh () { next if $@ || ! defined $sub; my @candidates; - if ($depends{$p}{$d} == $IkiWiki::DEPEND_EXISTS) { - @candidates=@exists_changed; - } - else { + if ($depends_simple{$p}{$d} & $IkiWiki::DEPEND_CONTENT) { @candidates=@changed; } + elsif ($depends{$p}{$d} & $IkiWiki::DEPEND_PRESENCE) { + @candidates=@exists_changed; + } # only consider internal files # if the page explicitly depends # on such files if ($d =~ /internal\(/) { - if ($depends{$p}{$d} == $IkiWiki::DEPEND_EXISTS) { - push @candidates, @internal; - } - else { + if ($depends_simple{$p}{$d} & $IkiWiki::DEPEND_CONTENT) { push @candidates, @internal, @internal_change; } + elsif ($depends{$p}{$d} & $IkiWiki::DEPEND_PRESENCE) { + push @candidates, @internal; + } } foreach my $file (@candidates) { |