response
[ikiwiki] / doc / todo / tracking_bugs_with_dependencies.mdwn
1 I like the idea of [[tips/integrated_issue_tracking_with_ikiwiki]], and I do so on several wikis.  However, as far as I can tell, ikiwiki has no functionality which can represent dependencies between bugs and allow pagespecs to select based on dependencies.  For instance, I can't write a pagespec which selects all bugs with no dependencies on bugs not marked as done.  --[[JoshTriplett]]
2
3 > I started having a think about this.  I'm going to start with the idea that expanding
4 > the pagespec syntax is the way to attack this.  It seems that any pagespec that is going
5 > to represent "all bugs with no dependencies on bugs not marked as done" is going to
6 > need some way to represent "bugs not marked as done" as a collection of pages, and
7 > then represent "bugs which do not link to pages in the previous collection".
8 >
9 > One way to do this would be to introduce variables into the pagespec, along with
10 > universal and/or existential [[!wikipedia Quantification]].  That looks quite complex.
11 >
12 >> I thought about this briefly, and got about that far.. glad you got
13 >> further. :-) --[[Joey]]
14
15 > Another option would be go with a more functional syntax.  The concept here would
16 > be to allow a pagespec to appear in a 'pagespec function' anywhere a page can.  e.g.
17 > I could pass a pagespec to `link()` and that would return true if there is a link to any
18 > page matching the pagespec.  This makes the variables and existential quantification
19 > implicit.  It would allow the example requested above:
20 >
21 >> `bugs/* and !*/Discussion and !link(bugs/* and !*/Discussion and !link(done))`
22 >
23 > Unfortunately, this is also going to make the pagespec parsing more complex because
24 > we now need to parse nested sets of parentheses to know when the nested pagespec
25 > ends, and that isn't a regular language (we can't use regular expression matching for
26 > easy parsing).
27 >
28 >> Also, it may cause ambiguities with page names that contain parens
29 >> (though some such ambigutities already exist with the pagespec syntax).
30 >
31 > One simplification of that would be to introduce some pagespec [[shortcuts]].  We could
32 > then allow pagespec functions to take either pages, or named pagespec shortcuts.  The
33 > pagespec shortcuts would just be listed on a special page, like current [[shortcuts]].
34 > (It would probably be a good idea to require that shortcuts on that page can only refer
35 > to named pagespecs higher up that page than themselves.  That would stop some
36 > looping issues...)  These shortcuts would be used as follows: when trying to match
37 > a page (without globs) you look to see if the page exists.  If it does then you have a
38 > match.  If it doesn't, then you look to see if a similarly named pagespec shortcut
39 > exists.  If it does, then you check that pagespec recursively to see if you have a match.
40 > The ordering requirement on named pagespecs stops infinite recursion.
41 >
42 > Does that seem like a reasonable first approach?
43 >
44 > -- [[Will]]
45
46 >> Having a separate page for the shortcuts feels unwieldly.. perhaps
47 >> instead the shortcut could be defined earlier in the scope of the same
48 >> pagespec that uses it?
49 >> 
50 >> Example: `define(~bugs, bugs/* and !*/Discussion) and define(~openbugs, ~bugs and !link(done)) and ~openbugs and !link(~openbugs)`
51
52 >>> That could work.  parens are only ever nested 1 deep in that grammar so it is regular and the current parsing would be ok.
53
54 >> Note that I made the "~" explicit, not implicit, so it could be left out. In the case of ambiguity between
55 >> a definition and a page name, the definition would win.
56
57 >>> That was my initial thought too :), but when implementing it I decided that requiring the ~ made things easier.  I'll probably require the ~ for the first pass at least.
58
59 >> So, equivilant example: `define(bugs, bugs/* and !*/Discussion) and define(openbugs, bugs and !link(done)) and openbugs and !link(openbugs)`
60 >> 
61 >> Re recursion, it is avoided.. but building a pagespec that is O(N^X) where N is the
62 >> number of pages in the wiki is not avoided. Probably need to add DOS prevention.
63 >>  --[[Joey]]
64
65 >>> If you memoize the outcomes of the named pagespecs you can make in O(N.X), no?
66 >>> -- [[Will]]
67
68 >>>> Yeah, guess that'd work. :-)
69
70 > One quick further thought.  All the above discussion assumes that 'dependency' is the
71 > same as 'links to', which is not really true.  For example, you'd like to be able to say
72 > "This bug does not depend upon [ [ link to other bug ] ]" and not have a dependency.
73 > Without having different types of links, I don't see how this would be possible.
74 >
75 > -- [[Will]]
76
77 Okie - I've had a quick attempt at this.  Initial patch attached.  This one doesn't quite work.
78 And there is still a lot of debugging stuff in there.
79
80 At the moment I've added a new preprocessor plugin, `definepagespec`, which is like
81 shortcut for pagespecs.  To reference a named pagespec, use `~` like this:
82
83     [ [!definepagespec name="bugs" spec="bugs/* and !*/Discussion"]]
84     [ [!definepagespec name="openbugs" spec="~bugs and !link(done)"]]
85     [ [!definepagespec name="readybugs" spec="~openbugs and !link(~openbugs)"]]
86
87 At the moment the problem is in `match_link()` when we're trying to find a sub-page that
88 matches the appropriate page spec.  There is no good list of pages available to iterate over.
89
90     foreach my $nextpage (keys %IkiWiki::pagesources)
91
92 does not give me a good list of pages.  I found the same thing when I was working on
93 this todo [[todo/Add_a_plugin_to_list_available_pre-processor_commands]].
94
95 > I'm not sure why iterating over `%pagesources` wouldn't work here, it's the same method
96 > used by anything that needs to match a pagespec against all pages..? --[[Joey]]
97
98 >> My uchecked hypothesis is that %pagesources is created after the refresh hook.
99 >> I've also been concerned about how globally defined pagespec shortcuts would interact with
100 >> the page dependancy system.  Your idea of internally defined shortcuts should fix that. -- [[Will]]
101
102 >>> You're correct, the refresh hook is run very early, before pagesources
103 >>> is populated. (It will be partially populated on a refresh, but will
104 >>> not be updated to reflect new pages.) Agree that internally defined
105 >>> seems the way to go. --[[Joey]]
106
107 Immediately below is a patch which seems to basically work.  Lots of debugging code is still there
108 and it needs a cleanup, but I thought it worth posting at this point.  (I was having problems
109 with old style glob lists, so i just switched them off for the moment.)
110
111 The following three inlines work for me with this patch:
112
113     Bugs:
114     
115     [ [!inline pages="define(~bugs, bugs/* and ! */Discussion) and ~bugs" archive="yes"]]
116     
117     OpenBugs:
118     
119     [ [!inline pages="define(~bugs, bugs/* and ! */Discussion) and define(~openbugs,~bugs and !link(done)) and ~openbugs" archive="yes"]]
120     
121     ReadyBugs:
122     
123     [ [!inline pages="define(~bugs, bugs/* and ! */Discussion) and define(~openbugs,~bugs and !link(done)) and define(~readybugs,~openbugs and !link(~openbugs)) and ~readybugs" archive="yes"]]
124
125 > Nice! Could the specfuncsref be passed in %params? I'd like to avoid
126 > needing to change the prototype of every pagespec function, since several
127 > plugins define them too. --[[Joey]]
128
129 ----
130
131 diff --git a/IkiWiki.pm b/IkiWiki.pm
132 index e476521..07b71d7 100644
133 --- a/IkiWiki.pm
134 +++ b/IkiWiki.pm
135 @@ -1524,7 +1524,7 @@ sub globlist_to_pagespec ($) { #{{{
136  
137  sub is_globlist ($) { #{{{
138         my $s=shift;
139 -       return ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
140 +       return 0; #( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
141  } #}}}
142  
143  sub safequote ($) { #{{{
144 @@ -1605,7 +1605,7 @@ sub pagespec_merge ($$) { #{{{
145         return "($a) or ($b)";
146  } #}}}
147  
148 -sub pagespec_translate ($) { #{{{
149 +sub pagespec_makeperl ($) { #{{{
150         my $spec=shift;
151  
152         # Support for old-style GlobLists.
153 @@ -1624,9 +1624,11 @@ sub pagespec_translate ($) { #{{{
154                 |
155                         \)              # )
156                 |
157 -                       \w+\([^\)]*\)   # command(params)
158 +                       define\(\s*~\w+\s*,((\([^\(\)]*\)) | ([^\(\)]+))+\)     # define(~specName, spec) - spec can contain parens 1 deep
159 +               |
160 +                       \w+\([^\(\)]*\) # command(params) - params cannot contain parens
161                 |
162 -                       [^\s()]+        # any other text
163 +                       [^\s\(\)]+      # any other text
164                 )
165                 \s*             # ignore whitespace
166         }igx) {
167 @@ -1640,16 +1642,23 @@ sub pagespec_translate ($) { #{{{
168                 elsif ($word eq "(" || $word eq ")" || $word eq "!") {
169                         $code.=' '.$word;
170                 }
171 +               elsif ($word =~ /^define\(\s*~(\w+)\s*,(.*)\)$/) {
172 +                       $code .= " (\$specFuncsRef->{$1}=";
173 +                       #$code .= "memoize(";
174 +                       $code .= pagespec_makeperl($2);
175 +                       #$code .= ")";
176 +                       $code .= ") ";
177 +               }
178                 elsif ($word =~ /^(\w+)\((.*)\)$/) {
179                         if (exists $IkiWiki::PageSpec::{"match_$1"}) {
180 -                               $code.="IkiWiki::PageSpec::match_$1(\$page, ".safequote($2).", \@_)";
181 +                               $code.="IkiWiki::PageSpec::match_$1(\$page, \$specFuncsRef, ".safequote($2).", \@_)";
182                         }
183                         else {
184                                 $code.=' 0';
185                         }
186                 }
187                 else {
188 -                       $code.=" IkiWiki::PageSpec::match_glob(\$page, ".safequote($word).", \@_)";
189 +                       $code.=" IkiWiki::PageSpec::match_glob(\$page, \$specFuncsRef, ".safequote($word).", \@_)";
190                 }
191         }
192  
193 @@ -1657,8 +1666,18 @@ sub pagespec_translate ($) { #{{{
194                 $code=0;
195         }
196  
197 +       return 'sub { my $page=shift; my $specFuncsRef=shift; '.$code.' }';
198 +} #}}}
199 +
200 +sub pagespec_translate ($) { #{{{
201 +       my $spec=shift;
202 +
203 +       my $code = pagespec_makeperl($spec);
204 +
205 +       print "Spec '$spec' led to perl '$code'\n";
206 +
207         no warnings;
208 -       return eval 'sub { my $page=shift; '.$code.' }';
209 +       return eval $code;
210  } #}}}
211  
212  sub pagespec_match ($$;@) { #{{{
213 @@ -1673,7 +1692,7 @@ sub pagespec_match ($$;@) { #{{{
214  
215         my $sub=pagespec_translate($spec);
216         return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@;
217 -       return $sub->($page, @params);
218 +       return $sub->($page, {}, @params);
219  } #}}}
220  
221  sub pagespec_valid ($) { #{{{
222 @@ -1722,13 +1741,77 @@ sub new { #{{{
223  
224  package IkiWiki::PageSpec;
225  
226 -sub match_glob ($$;@) { #{{{
227 +sub check_named_spec($$$;@) {
228 +       my $page=shift;
229 +       my $specFuncsRef=shift;
230 +       my $specName=shift;
231 +       my %params=@_;
232 +       
233 +       return IkiWiki::FailReason->new("Named page spec '$specName' is not valid")
234 +               unless (substr($specName, 0, 1) eq '~');
235 +       
236 +       $specName = substr($specName, 1);
237 +       print "Checking pagespec named $specName against page $page\n";
238 +       if (exists $specFuncsRef->{$specName}) {
239 +               # remove the named spec from the spec refs
240 +               # when we recurse to avoid infinite recursion
241 +               my $sub = $specFuncsRef->{$specName};
242 +               $specFuncsRef->{$specName} = undef;
243 +               my $result = $sub->($page, $specFuncsRef, %params);
244 +               $specFuncsRef->{$specName} = $sub;
245 +               return $result;
246 +       } else {
247 +               print "Couldn't find pagespec\n";
248 +               return IkiWiki::FailReason->new("Page spec $specName does not exist");
249 +       }
250 +}
251 +
252 +sub check_named_spec_existential($$$$;@) {
253 +       my $page=shift;
254 +       my $specFuncsRef=shift;
255 +       my $specName=shift;
256 +       my $funcref=shift;
257 +       my %params=@_;
258 +       
259 +       return IkiWiki::FailReason->new("Named page spec '$specName' is not valid")
260 +               unless (substr($specName, 0, 1) eq '~');
261 +       $specName = substr($specName, 1);
262 +       
263 +       print "Checking (existential) pagespec named $specName against page $page\n";
264 +       
265 +       if (exists $specFuncsRef->{$specName}) {
266 +               # remove the named spec from the spec refs
267 +               # when we recurse to avoid infinite recursion
268 +               my $sub = $specFuncsRef->{$specName};
269 +               $specFuncsRef->{$specName} = undef;
270 +               
271 +               foreach my $nextpage (keys %IkiWiki::pagesources) {
272 +                       print "Checking $nextpage against $specName\n";
273 +                       if ($sub->($nextpage, $specFuncsRef, %params)) {
274 +                               print "Match!  Checking spec $nextpage against function from original page $page\n";
275 +                               my $tempResult = $funcref->($page, $specFuncsRef, $nextpage, %params);
276 +                               return $tempResult if ($tempResult);
277 +                       }
278 +               }
279 +               
280 +               $specFuncsRef->{$specName} = $sub;
281 +               return IkiWiki::FailReason->new("No page in spec $specName was successfully matched");
282 +       } else {
283 +               print "Couldn't find pagespec\n";
284 +               return IkiWiki::FailReason->new("Page spec $specName does not exist");
285 +       }
286 +}
287 +
288 +sub match_glob ($$$;@) { #{{{
289         my $page=shift;
290 +       my $specFuncsRef=shift;
291         my $glob=shift;
292         my %params=@_;
293         
294         my $from=exists $params{location} ? $params{location} : '';
295         
296 +       print "Matching glob $glob \n";
297 +       
298         # relative matching
299         if ($glob =~ m!^\./!) {
300                 $from=~s#/?[^/]+$##;
301 @@ -1736,6 +1819,10 @@ sub match_glob ($$;@) { #{{{
302                 $glob="$from/$glob" if length $from;
303         }
304  
305 +       if (substr($glob, 0, 1) eq '~') {
306 +               return check_named_spec($page, $specFuncsRef, $glob);
307 +       }
308 +
309         my $regexp=IkiWiki::glob2re($glob);
310         if ($page=~/^$regexp$/i) {
311                 if (! IkiWiki::isinternal($page) || $params{internal}) {
312 @@ -1750,17 +1837,29 @@ sub match_glob ($$;@) { #{{{
313         }
314  } #}}}
315  
316 -sub match_internal ($$;@) { #{{{
317 -       return match_glob($_[0], $_[1], @_, internal => 1)
318 +sub match_internal ($$$;@) { #{{{
319 +       my $page=shift;
320 +       my $specFuncsRef=shift;
321 +       my $glob=shift;
322 +
323 +       return match_glob($page, $specFuncsRef, $glob, @_, internal => 1)
324  } #}}}
325  
326 -sub match_link ($$;@) { #{{{
327 +sub match_link ($$$;@) { #{{{
328         my $page=shift;
329 -       my $link=lc(shift);
330 +       my $specFuncsRef=shift;
331 +       my $fulllink=shift;
332 +       my $link=lc($fulllink);
333         my %params=@_;
334  
335 +       print "Matching link $fulllink \n";
336 +       
337         my $from=exists $params{location} ? $params{location} : '';
338  
339 +       if (substr($fulllink, 0, 1) eq '~') {
340 +               return check_named_spec_existential($page, $specFuncsRef, $fulllink, \&match_link);
341 +       }
342 +
343         # relative matching
344         if ($link =~ m!^\.! && defined $from) {
345                 $from=~s#/?[^/]+$##;
346 @@ -1784,12 +1883,16 @@ sub match_link ($$;@) { #{{{
347         return IkiWiki::FailReason->new("$page does not link to $link");
348  } #}}}
349  
350 -sub match_backlink ($$;@) { #{{{
351 -       return match_link($_[1], $_[0], @_);
352 +sub match_backlink ($$$;@) { #{{{
353 +       my $page=shift;
354 +       my $specFuncsRef=shift;
355 +       my $backlink=shift;
356 +       return match_link($backlink, $specFuncsRef, $page, @_);
357  } #}}}
358  
359 -sub match_created_before ($$;@) { #{{{
360 +sub match_created_before ($$$;@) { #{{{
361         my $page=shift;
362 +       my $specFuncsRef=shift;
363         my $testpage=shift;
364  
365         if (exists $IkiWiki::pagectime{$testpage}) {
366 @@ -1805,8 +1908,9 @@ sub match_created_before ($$;@) { #{{{
367         }
368  } #}}}
369  
370 -sub match_created_after ($$;@) { #{{{
371 +sub match_created_after ($$$;@) { #{{{
372         my $page=shift;
373 +       my $specFuncsRef=shift;
374         my $testpage=shift;
375  
376         if (exists $IkiWiki::pagectime{$testpage}) {
377 @@ -1822,8 +1926,12 @@ sub match_created_after ($$;@) { #{{{
378         }
379  } #}}}
380  
381 -sub match_creation_day ($$;@) { #{{{
382 -       if ((gmtime($IkiWiki::pagectime{shift()}))[3] == shift) {
383 +sub match_creation_day ($$$;@) { #{{{
384 +       my $page=shift;
385 +       shift;
386 +       my $time=shift;
387 +
388 +       if ((gmtime($IkiWiki::pagectime{$page}))[3] == $time) {
389                 return IkiWiki::SuccessReason->new('creation_day matched');
390         }
391         else {
392 @@ -1831,8 +1939,12 @@ sub match_creation_day ($$;@) { #{{{
393         }
394  } #}}}
395  
396 -sub match_creation_month ($$;@) { #{{{
397 -       if ((gmtime($IkiWiki::pagectime{shift()}))[4] + 1 == shift) {
398 +sub match_creation_month ($$$;@) { #{{{
399 +       my $page=shift;
400 +       shift;
401 +       my $time=shift;
402 +
403 +       if ((gmtime($IkiWiki::pagectime{$page}))[4] + 1 == $time) {
404                 return IkiWiki::SuccessReason->new('creation_month matched');
405         }
406         else {
407 @@ -1840,8 +1952,12 @@ sub match_creation_month ($$;@) { #{{{
408         }
409  } #}}}
410  
411 -sub match_creation_year ($$;@) { #{{{
412 -       if ((gmtime($IkiWiki::pagectime{shift()}))[5] + 1900 == shift) {
413 +sub match_creation_year ($$$;@) { #{{{
414 +       my $page=shift;
415 +       shift;
416 +       my $time=shift;
417 +
418 +       if ((gmtime($IkiWiki::pagectime{$page}))[5] + 1900 == $time) {
419                 return IkiWiki::SuccessReason->new('creation_year matched');
420         }
421         else {
422 diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
423 index f1f792a..a410e48 100644
424 --- a/IkiWiki/Plugin/attachment.pm
425 +++ b/IkiWiki/Plugin/attachment.pm
426 @@ -291,7 +291,8 @@ sub attachment_list ($) { #{{{
427  
428  package IkiWiki::PageSpec;
429  
430 -sub match_user ($$;@) { #{{{
431 +sub match_user ($$$;@) { #{{{
432 +       shift;
433         shift;
434         my $user=shift;
435         my %params=@_;
436 @@ -311,7 +312,8 @@ sub match_user ($$;@) { #{{{
437         }
438  } #}}}
439  
440 -sub match_ip ($$;@) { #{{{
441 +sub match_ip ($$$;@) { #{{{
442 +       shift;
443         shift;
444         my $ip=shift;
445         my %params=@_;
446 diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm
447 index 7716fce..2110ca0 100644
448 --- a/IkiWiki/Plugin/conditional.pm
449 +++ b/IkiWiki/Plugin/conditional.pm
450 @@ -70,7 +70,8 @@ sub preprocess_if (@) { #{{{
451  
452  package IkiWiki::PageSpec;
453  
454 -sub match_enabled ($$;@) { #{{{
455 +sub match_enabled ($$$;@) { #{{{
456 +       shift;
457         shift;
458         my $plugin=shift;
459         
460 @@ -83,13 +84,14 @@ sub match_enabled ($$;@) { #{{{
461         }
462  } #}}}
463  
464 -sub match_sourcepage ($$;@) { #{{{
465 +sub match_sourcepage ($$$;@) { #{{{
466         shift;
467 +       my $specFuncsRef=shift;
468         my $glob=shift;
469         my %params=@_;
470  
471         return IkiWiki::FailReason->new("cannot match sourcepage") unless exists $params{sourcepage};
472 -       if (match_glob($params{sourcepage}, $glob, @_)) {
473 +       if (match_glob($params{sourcepage}, $specFuncsRef, $glob, @_)) {
474                 return IkiWiki::SuccessReason->new("sourcepage matches $glob");
475         }
476         else {
477 @@ -97,13 +99,14 @@ sub match_sourcepage ($$;@) { #{{{
478         }
479  } #}}}
480  
481 -sub match_destpage ($$;@) { #{{{
482 +sub match_destpage ($$$;@) { #{{{
483         shift;
484 +       my $specFuncsRef=shift;
485         my $glob=shift;
486         my %params=@_;
487         
488         return IkiWiki::FailReason->new("cannot match destpage") unless exists $params{destpage};
489 -       if (match_glob($params{destpage}, $glob, @_)) {
490 +       if (match_glob($params{destpage}, $specFuncsRef, $glob, @_)) {
491                 return IkiWiki::SuccessReason->new("destpage matches $glob");
492         }
493         else {
494 @@ -111,7 +114,8 @@ sub match_destpage ($$;@) { #{{{
495         }
496  } #}}}
497  
498 -sub match_included ($$;@) { #{{{
499 +sub match_included ($$$;@) { #{{{
500 +       shift;
501         shift;
502         shift;
503         my %params=@_;
504 diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm
505 index 6f71be3..bf472c5 100644
506 --- a/IkiWiki/Plugin/filecheck.pm
507 +++ b/IkiWiki/Plugin/filecheck.pm
508 @@ -66,8 +66,9 @@ sub humansize ($) { #{{{
509  
510  package IkiWiki::PageSpec;
511  
512 -sub match_maxsize ($$;@) { #{{{
513 +sub match_maxsize ($$$;@) { #{{{
514         my $page=shift;
515 +       shift;
516         my $maxsize=eval{IkiWiki::Plugin::attachment::parsesize(shift)};
517         if ($@) {
518                 return IkiWiki::FailReason->new("unable to parse maxsize (or number too large)");
519 @@ -87,8 +88,9 @@ sub match_maxsize ($$;@) { #{{{
520         }
521  } #}}}
522  
523 -sub match_minsize ($$;@) { #{{{
524 +sub match_minsize ($$$;@) { #{{{
525         my $page=shift;
526 +       shift;
527         my $minsize=eval{IkiWiki::Plugin::attachment::parsesize(shift)};
528         if ($@) {
529                 return IkiWiki::FailReason->new("unable to parse minsize (or number too large)");
530 @@ -108,8 +110,9 @@ sub match_minsize ($$;@) { #{{{
531         }
532  } #}}}
533  
534 -sub match_mimetype ($$;@) { #{{{
535 +sub match_mimetype ($$$;@) { #{{{
536         my $page=shift;
537 +       shift;
538         my $wanted=shift;
539  
540         my %params=@_;
541 @@ -138,8 +141,9 @@ sub match_mimetype ($$;@) { #{{{
542         }
543  } #}}}
544  
545 -sub match_virusfree ($$;@) { #{{{
546 +sub match_virusfree ($$$;@) { #{{{
547         my $page=shift;
548 +       shift;
549         my $wanted=shift;
550  
551         my %params=@_;
552 @@ -180,7 +184,7 @@ sub match_virusfree ($$;@) { #{{{
553         }
554  } #}}}
555  
556 -sub match_ispage ($$;@) { #{{{
557 +sub match_ispage ($$$;@) { #{{{
558         my $filename=shift;
559  
560         if (defined IkiWiki::pagetype($filename)) {
561 diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
562 index b2c85c8..1ee6a69 100644
563 --- a/IkiWiki/Plugin/meta.pm
564 +++ b/IkiWiki/Plugin/meta.pm
565 @@ -264,6 +264,7 @@ sub pagetemplate (@) { #{{{
566  sub match { #{{{
567         my $field=shift;
568         my $page=shift;
569 +       shift;
570         
571         # turn glob into a safe regexp
572         my $re=IkiWiki::glob2re(shift);
573 @@ -291,23 +292,23 @@ sub match { #{{{
574  
575  package IkiWiki::PageSpec;
576  
577 -sub match_title ($$;@) { #{{{
578 +sub match_title ($$$;@) { #{{{
579         IkiWiki::Plugin::meta::match("title", @_);      
580  } #}}}
581  
582 -sub match_author ($$;@) { #{{{
583 +sub match_author ($$$;@) { #{{{
584         IkiWiki::Plugin::meta::match("author", @_);
585  } #}}}
586  
587 -sub match_authorurl ($$;@) { #{{{
588 +sub match_authorurl ($$$;@) { #{{{
589         IkiWiki::Plugin::meta::match("authorurl", @_);
590  } #}}}
591  
592 -sub match_license ($$;@) { #{{{
593 +sub match_license ($$$;@) { #{{{
594         IkiWiki::Plugin::meta::match("license", @_);
595  } #}}}
596  
597 -sub match_copyright ($$;@) { #{{{
598 +sub match_copyright ($$$;@) { #{{{
599         IkiWiki::Plugin::meta::match("copyright", @_);
600  } #}}}
601