use pagespec_match_list
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Mon, 24 Aug 2009 23:21:19 +0000 (00:21 +0100)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Mon, 24 Aug 2009 23:31:24 +0000 (00:31 +0100)
IkiWiki/Render.pm

index b9f1d7754171004b32cc196230a530e12236b36e..fb28b6e3bb43b48f182496944fcd61df8029d5b4 100644 (file)
@@ -462,15 +462,17 @@ sub refresh () {
                                foreach my $d (keys %{$depends{$p}}) {
                                        # only consider internal files
                                        # if the page explicitly depends on such files
-                                       foreach my $file (@changed, $d=~/internal\(/ ? @internal : ()) {
-                                               next if $f eq $file;
-                                               my $page=pagename($file);
-                                               if (pagespec_match($page, $d, location => $p)) {
-                                                       debug(sprintf(gettext("building %s, which depends on %s"), $f, $page));
-                                                       render($f);
-                                                       $rendered{$f}=1;
-                                                       next F;
-                                               }
+                                       my @pages = map {
+                                               pagename($_)
+                                       } grep {
+                                               $_ ne $f
+                                       } (@changed, $d =~ /internal\(/ ? @internal : ());
+                                       @pages = pagespec_match_list(\@pages, $d, location => $p);
+                                       if (@pages) {
+                                               debug(sprintf(gettext("building %s, which depends on %s"), $f, $pages[0]));
+                                               render($f);
+                                               $rendered{$f}=1;
+                                               next F;
                                        }
                                }
                        }