Major patch update
[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 ----
126
127 diff --git a/IkiWiki.pm b/IkiWiki.pm
128 index e476521..07b71d7 100644
129 --- a/IkiWiki.pm
130 +++ b/IkiWiki.pm
131 @@ -1524,7 +1524,7 @@ sub globlist_to_pagespec ($) { #{{{
132  
133  sub is_globlist ($) { #{{{
134         my $s=shift;
135 -       return ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
136 +       return 0; #( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
137  } #}}}
138  
139  sub safequote ($) { #{{{
140 @@ -1605,7 +1605,7 @@ sub pagespec_merge ($$) { #{{{
141         return "($a) or ($b)";
142  } #}}}
143  
144 -sub pagespec_translate ($) { #{{{
145 +sub pagespec_makeperl ($) { #{{{
146         my $spec=shift;
147  
148         # Support for old-style GlobLists.
149 @@ -1624,9 +1624,11 @@ sub pagespec_translate ($) { #{{{
150                 |
151                         \)              # )
152                 |
153 -                       \w+\([^\)]*\)   # command(params)
154 +                       define\(\s*~\w+\s*,((\([^\(\)]*\)) | ([^\(\)]+))+\)     # define(~specName, spec) - spec can contain parens 1 deep
155 +               |
156 +                       \w+\([^\(\)]*\) # command(params) - params cannot contain parens
157                 |
158 -                       [^\s()]+        # any other text
159 +                       [^\s\(\)]+      # any other text
160                 )
161                 \s*             # ignore whitespace
162         }igx) {
163 @@ -1640,16 +1642,23 @@ sub pagespec_translate ($) { #{{{
164                 elsif ($word eq "(" || $word eq ")" || $word eq "!") {
165                         $code.=' '.$word;
166                 }
167 +               elsif ($word =~ /^define\(\s*~(\w+)\s*,(.*)\)$/) {
168 +                       $code .= " (\$specFuncsRef->{$1}=";
169 +                       #$code .= "memoize(";
170 +                       $code .= pagespec_makeperl($2);
171 +                       #$code .= ")";
172 +                       $code .= ") ";
173 +               }
174                 elsif ($word =~ /^(\w+)\((.*)\)$/) {
175                         if (exists $IkiWiki::PageSpec::{"match_$1"}) {
176 -                               $code.="IkiWiki::PageSpec::match_$1(\$page, ".safequote($2).", \@_)";
177 +                               $code.="IkiWiki::PageSpec::match_$1(\$page, \$specFuncsRef, ".safequote($2).", \@_)";
178                         }
179                         else {
180                                 $code.=' 0';
181                         }
182                 }
183                 else {
184 -                       $code.=" IkiWiki::PageSpec::match_glob(\$page, ".safequote($word).", \@_)";
185 +                       $code.=" IkiWiki::PageSpec::match_glob(\$page, \$specFuncsRef, ".safequote($word).", \@_)";
186                 }
187         }
188  
189 @@ -1657,8 +1666,18 @@ sub pagespec_translate ($) { #{{{
190                 $code=0;
191         }
192  
193 +       return 'sub { my $page=shift; my $specFuncsRef=shift; '.$code.' }';
194 +} #}}}
195 +
196 +sub pagespec_translate ($) { #{{{
197 +       my $spec=shift;
198 +
199 +       my $code = pagespec_makeperl($spec);
200 +
201 +       print "Spec '$spec' led to perl '$code'\n";
202 +
203         no warnings;
204 -       return eval 'sub { my $page=shift; '.$code.' }';
205 +       return eval $code;
206  } #}}}
207  
208  sub pagespec_match ($$;@) { #{{{
209 @@ -1673,7 +1692,7 @@ sub pagespec_match ($$;@) { #{{{
210  
211         my $sub=pagespec_translate($spec);
212         return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@;
213 -       return $sub->($page, @params);
214 +       return $sub->($page, {}, @params);
215  } #}}}
216  
217  sub pagespec_valid ($) { #{{{
218 @@ -1722,13 +1741,77 @@ sub new { #{{{
219  
220  package IkiWiki::PageSpec;
221  
222 -sub match_glob ($$;@) { #{{{
223 +sub check_named_spec($$$;@) {
224 +       my $page=shift;
225 +       my $specFuncsRef=shift;
226 +       my $specName=shift;
227 +       my %params=@_;
228 +       
229 +       return IkiWiki::FailReason->new("Named page spec '$specName' is not valid")
230 +               unless (substr($specName, 0, 1) eq '~');
231 +       
232 +       $specName = substr($specName, 1);
233 +       print "Checking pagespec named $specName against page $page\n";
234 +       if (exists $specFuncsRef->{$specName}) {
235 +               # remove the named spec from the spec refs
236 +               # when we recurse to avoid infinite recursion
237 +               my $sub = $specFuncsRef->{$specName};
238 +               $specFuncsRef->{$specName} = undef;
239 +               my $result = $sub->($page, $specFuncsRef, %params);
240 +               $specFuncsRef->{$specName} = $sub;
241 +               return $result;
242 +       } else {
243 +               print "Couldn't find pagespec\n";
244 +               return IkiWiki::FailReason->new("Page spec $specName does not exist");
245 +       }
246 +}
247 +
248 +sub check_named_spec_existential($$$$;@) {
249 +       my $page=shift;
250 +       my $specFuncsRef=shift;
251 +       my $specName=shift;
252 +       my $funcref=shift;
253 +       my %params=@_;
254 +       
255 +       return IkiWiki::FailReason->new("Named page spec '$specName' is not valid")
256 +               unless (substr($specName, 0, 1) eq '~');
257 +       $specName = substr($specName, 1);
258 +       
259 +       print "Checking (existential) pagespec named $specName against page $page\n";
260 +       
261 +       if (exists $specFuncsRef->{$specName}) {
262 +               # remove the named spec from the spec refs
263 +               # when we recurse to avoid infinite recursion
264 +               my $sub = $specFuncsRef->{$specName};
265 +               $specFuncsRef->{$specName} = undef;
266 +               
267 +               foreach my $nextpage (keys %IkiWiki::pagesources) {
268 +                       print "Checking $nextpage against $specName\n";
269 +                       if ($sub->($nextpage, $specFuncsRef, %params)) {
270 +                               print "Match!  Checking spec $nextpage against function from original page $page\n";
271 +                               my $tempResult = $funcref->($page, $specFuncsRef, $nextpage, %params);
272 +                               return $tempResult if ($tempResult);
273 +                       }
274 +               }
275 +               
276 +               $specFuncsRef->{$specName} = $sub;
277 +               return IkiWiki::FailReason->new("No page in spec $specName was successfully matched");
278 +       } else {
279 +               print "Couldn't find pagespec\n";
280 +               return IkiWiki::FailReason->new("Page spec $specName does not exist");
281 +       }
282 +}
283 +
284 +sub match_glob ($$$;@) { #{{{
285         my $page=shift;
286 +       my $specFuncsRef=shift;
287         my $glob=shift;
288         my %params=@_;
289         
290         my $from=exists $params{location} ? $params{location} : '';
291         
292 +       print "Matching glob $glob \n";
293 +       
294         # relative matching
295         if ($glob =~ m!^\./!) {
296                 $from=~s#/?[^/]+$##;
297 @@ -1736,6 +1819,10 @@ sub match_glob ($$;@) { #{{{
298                 $glob="$from/$glob" if length $from;
299         }
300  
301 +       if (substr($glob, 0, 1) eq '~') {
302 +               return check_named_spec($page, $specFuncsRef, $glob);
303 +       }
304 +
305         my $regexp=IkiWiki::glob2re($glob);
306         if ($page=~/^$regexp$/i) {
307                 if (! IkiWiki::isinternal($page) || $params{internal}) {
308 @@ -1750,17 +1837,29 @@ sub match_glob ($$;@) { #{{{
309         }
310  } #}}}
311  
312 -sub match_internal ($$;@) { #{{{
313 -       return match_glob($_[0], $_[1], @_, internal => 1)
314 +sub match_internal ($$$;@) { #{{{
315 +       my $page=shift;
316 +       my $specFuncsRef=shift;
317 +       my $glob=shift;
318 +
319 +       return match_glob($page, $specFuncsRef, $glob, @_, internal => 1)
320  } #}}}
321  
322 -sub match_link ($$;@) { #{{{
323 +sub match_link ($$$;@) { #{{{
324         my $page=shift;
325 -       my $link=lc(shift);
326 +       my $specFuncsRef=shift;
327 +       my $fulllink=shift;
328 +       my $link=lc($fulllink);
329         my %params=@_;
330  
331 +       print "Matching link $fulllink \n";
332 +       
333         my $from=exists $params{location} ? $params{location} : '';
334  
335 +       if (substr($fulllink, 0, 1) eq '~') {
336 +               return check_named_spec_existential($page, $specFuncsRef, $fulllink, \&match_link);
337 +       }
338 +
339         # relative matching
340         if ($link =~ m!^\.! && defined $from) {
341                 $from=~s#/?[^/]+$##;
342 @@ -1784,12 +1883,16 @@ sub match_link ($$;@) { #{{{
343         return IkiWiki::FailReason->new("$page does not link to $link");
344  } #}}}
345  
346 -sub match_backlink ($$;@) { #{{{
347 -       return match_link($_[1], $_[0], @_);
348 +sub match_backlink ($$$;@) { #{{{
349 +       my $page=shift;
350 +       my $specFuncsRef=shift;
351 +       my $backlink=shift;
352 +       return match_link($backlink, $specFuncsRef, $page, @_);
353  } #}}}
354  
355 -sub match_created_before ($$;@) { #{{{
356 +sub match_created_before ($$$;@) { #{{{
357         my $page=shift;
358 +       my $specFuncsRef=shift;
359         my $testpage=shift;
360  
361         if (exists $IkiWiki::pagectime{$testpage}) {
362 @@ -1805,8 +1908,9 @@ sub match_created_before ($$;@) { #{{{
363         }
364  } #}}}
365  
366 -sub match_created_after ($$;@) { #{{{
367 +sub match_created_after ($$$;@) { #{{{
368         my $page=shift;
369 +       my $specFuncsRef=shift;
370         my $testpage=shift;
371  
372         if (exists $IkiWiki::pagectime{$testpage}) {
373 @@ -1822,8 +1926,12 @@ sub match_created_after ($$;@) { #{{{
374         }
375  } #}}}
376  
377 -sub match_creation_day ($$;@) { #{{{
378 -       if ((gmtime($IkiWiki::pagectime{shift()}))[3] == shift) {
379 +sub match_creation_day ($$$;@) { #{{{
380 +       my $page=shift;
381 +       shift;
382 +       my $time=shift;
383 +
384 +       if ((gmtime($IkiWiki::pagectime{$page}))[3] == $time) {
385                 return IkiWiki::SuccessReason->new('creation_day matched');
386         }
387         else {
388 @@ -1831,8 +1939,12 @@ sub match_creation_day ($$;@) { #{{{
389         }
390  } #}}}
391  
392 -sub match_creation_month ($$;@) { #{{{
393 -       if ((gmtime($IkiWiki::pagectime{shift()}))[4] + 1 == shift) {
394 +sub match_creation_month ($$$;@) { #{{{
395 +       my $page=shift;
396 +       shift;
397 +       my $time=shift;
398 +
399 +       if ((gmtime($IkiWiki::pagectime{$page}))[4] + 1 == $time) {
400                 return IkiWiki::SuccessReason->new('creation_month matched');
401         }
402         else {
403 @@ -1840,8 +1952,12 @@ sub match_creation_month ($$;@) { #{{{
404         }
405  } #}}}
406  
407 -sub match_creation_year ($$;@) { #{{{
408 -       if ((gmtime($IkiWiki::pagectime{shift()}))[5] + 1900 == shift) {
409 +sub match_creation_year ($$$;@) { #{{{
410 +       my $page=shift;
411 +       shift;
412 +       my $time=shift;
413 +
414 +       if ((gmtime($IkiWiki::pagectime{$page}))[5] + 1900 == $time) {
415                 return IkiWiki::SuccessReason->new('creation_year matched');
416         }
417         else {
418 diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
419 index f1f792a..a410e48 100644
420 --- a/IkiWiki/Plugin/attachment.pm
421 +++ b/IkiWiki/Plugin/attachment.pm
422 @@ -291,7 +291,8 @@ sub attachment_list ($) { #{{{
423  
424  package IkiWiki::PageSpec;
425  
426 -sub match_user ($$;@) { #{{{
427 +sub match_user ($$$;@) { #{{{
428 +       shift;
429         shift;
430         my $user=shift;
431         my %params=@_;
432 @@ -311,7 +312,8 @@ sub match_user ($$;@) { #{{{
433         }
434  } #}}}
435  
436 -sub match_ip ($$;@) { #{{{
437 +sub match_ip ($$$;@) { #{{{
438 +       shift;
439         shift;
440         my $ip=shift;
441         my %params=@_;
442 diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm
443 index 7716fce..2110ca0 100644
444 --- a/IkiWiki/Plugin/conditional.pm
445 +++ b/IkiWiki/Plugin/conditional.pm
446 @@ -70,7 +70,8 @@ sub preprocess_if (@) { #{{{
447  
448  package IkiWiki::PageSpec;
449  
450 -sub match_enabled ($$;@) { #{{{
451 +sub match_enabled ($$$;@) { #{{{
452 +       shift;
453         shift;
454         my $plugin=shift;
455         
456 @@ -83,13 +84,14 @@ sub match_enabled ($$;@) { #{{{
457         }
458  } #}}}
459  
460 -sub match_sourcepage ($$;@) { #{{{
461 +sub match_sourcepage ($$$;@) { #{{{
462         shift;
463 +       my $specFuncsRef=shift;
464         my $glob=shift;
465         my %params=@_;
466  
467         return IkiWiki::FailReason->new("cannot match sourcepage") unless exists $params{sourcepage};
468 -       if (match_glob($params{sourcepage}, $glob, @_)) {
469 +       if (match_glob($params{sourcepage}, $specFuncsRef, $glob, @_)) {
470                 return IkiWiki::SuccessReason->new("sourcepage matches $glob");
471         }
472         else {
473 @@ -97,13 +99,14 @@ sub match_sourcepage ($$;@) { #{{{
474         }
475  } #}}}
476  
477 -sub match_destpage ($$;@) { #{{{
478 +sub match_destpage ($$$;@) { #{{{
479         shift;
480 +       my $specFuncsRef=shift;
481         my $glob=shift;
482         my %params=@_;
483         
484         return IkiWiki::FailReason->new("cannot match destpage") unless exists $params{destpage};
485 -       if (match_glob($params{destpage}, $glob, @_)) {
486 +       if (match_glob($params{destpage}, $specFuncsRef, $glob, @_)) {
487                 return IkiWiki::SuccessReason->new("destpage matches $glob");
488         }
489         else {
490 @@ -111,7 +114,8 @@ sub match_destpage ($$;@) { #{{{
491         }
492  } #}}}
493  
494 -sub match_included ($$;@) { #{{{
495 +sub match_included ($$$;@) { #{{{
496 +       shift;
497         shift;
498         shift;
499         my %params=@_;
500 diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm
501 index 6f71be3..bf472c5 100644
502 --- a/IkiWiki/Plugin/filecheck.pm
503 +++ b/IkiWiki/Plugin/filecheck.pm
504 @@ -66,8 +66,9 @@ sub humansize ($) { #{{{
505  
506  package IkiWiki::PageSpec;
507  
508 -sub match_maxsize ($$;@) { #{{{
509 +sub match_maxsize ($$$;@) { #{{{
510         my $page=shift;
511 +       shift;
512         my $maxsize=eval{IkiWiki::Plugin::attachment::parsesize(shift)};
513         if ($@) {
514                 return IkiWiki::FailReason->new("unable to parse maxsize (or number too large)");
515 @@ -87,8 +88,9 @@ sub match_maxsize ($$;@) { #{{{
516         }
517  } #}}}
518  
519 -sub match_minsize ($$;@) { #{{{
520 +sub match_minsize ($$$;@) { #{{{
521         my $page=shift;
522 +       shift;
523         my $minsize=eval{IkiWiki::Plugin::attachment::parsesize(shift)};
524         if ($@) {
525                 return IkiWiki::FailReason->new("unable to parse minsize (or number too large)");
526 @@ -108,8 +110,9 @@ sub match_minsize ($$;@) { #{{{
527         }
528  } #}}}
529  
530 -sub match_mimetype ($$;@) { #{{{
531 +sub match_mimetype ($$$;@) { #{{{
532         my $page=shift;
533 +       shift;
534         my $wanted=shift;
535  
536         my %params=@_;
537 @@ -138,8 +141,9 @@ sub match_mimetype ($$;@) { #{{{
538         }
539  } #}}}
540  
541 -sub match_virusfree ($$;@) { #{{{
542 +sub match_virusfree ($$$;@) { #{{{
543         my $page=shift;
544 +       shift;
545         my $wanted=shift;
546  
547         my %params=@_;
548 @@ -180,7 +184,7 @@ sub match_virusfree ($$;@) { #{{{
549         }
550  } #}}}
551  
552 -sub match_ispage ($$;@) { #{{{
553 +sub match_ispage ($$$;@) { #{{{
554         my $filename=shift;
555  
556         if (defined IkiWiki::pagetype($filename)) {
557 diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
558 index b2c85c8..1ee6a69 100644
559 --- a/IkiWiki/Plugin/meta.pm
560 +++ b/IkiWiki/Plugin/meta.pm
561 @@ -264,6 +264,7 @@ sub pagetemplate (@) { #{{{
562  sub match { #{{{
563         my $field=shift;
564         my $page=shift;
565 +       shift;
566         
567         # turn glob into a safe regexp
568         my $re=IkiWiki::glob2re(shift);
569 @@ -291,23 +292,23 @@ sub match { #{{{
570  
571  package IkiWiki::PageSpec;
572  
573 -sub match_title ($$;@) { #{{{
574 +sub match_title ($$$;@) { #{{{
575         IkiWiki::Plugin::meta::match("title", @_);      
576  } #}}}
577  
578 -sub match_author ($$;@) { #{{{
579 +sub match_author ($$$;@) { #{{{
580         IkiWiki::Plugin::meta::match("author", @_);
581  } #}}}
582  
583 -sub match_authorurl ($$;@) { #{{{
584 +sub match_authorurl ($$$;@) { #{{{
585         IkiWiki::Plugin::meta::match("authorurl", @_);
586  } #}}}
587  
588 -sub match_license ($$;@) { #{{{
589 +sub match_license ($$$;@) { #{{{
590         IkiWiki::Plugin::meta::match("license", @_);
591  } #}}}
592  
593 -sub match_copyright ($$;@) { #{{{
594 +sub match_copyright ($$$;@) { #{{{
595         IkiWiki::Plugin::meta::match("copyright", @_);
596  } #}}}
597