diff options
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r-- | IkiWiki/Render.pm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 35e279a68..be6e6d1cb 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -158,10 +158,31 @@ sub add_depends ($$) { #{{{ $depends{$page}=$globlist; } else { - $depends{$page}.=" ".$globlist; + $depends{$page}=globlist_merge($depends{$page}, $globlist); } } # }}} +sub globlist_merge ($$) { #{{{ + my $a=shift; + my $b=shift; + + my $ret=""; + # Only add negated globs if they are not matched by the other globlist. + foreach my $i ((map { [ $a, $_ ] } split(" ", $b)), + (map { [ $b, $_ ] } split(" ", $a))) { + if ($i->[1]=~/^!(.*)/) { + if (! globlist_match($1, $i->[0])) { + $ret.=" ".$i->[1]; + } + } + else { + $ret.=" ".$i->[1]; + } + } + + return $ret; +} #}}} + sub genpage ($$$) { #{{{ my $content=shift; my $page=shift; |