aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Render.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-05-02 15:22:49 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-05-02 15:22:49 +0000
commit47cec07e4441a06bb741910a329215d4d6ad0a86 (patch)
treeab24862ee6feb7f814d81eded753e200a825aefe /IkiWiki/Render.pm
parentf9ce7a571ddbe124bb93bcfd3388e2cd4d77ec06 (diff)
downloadikiwiki-47cec07e4441a06bb741910a329215d4d6ad0a86.tar
ikiwiki-47cec07e4441a06bb741910a329215d4d6ad0a86.tar.gz
ah, the joys of test-based development..
think I have smart glob list matching working ok
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r--IkiWiki/Render.pm23
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;