From 58141a0ebcdf3313a83af712b83f8acd1c08aa3b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 6 Feb 2007 21:17:25 +0000 Subject: * Patch based on a patch from Ethan to support relative matching in PageSpecs, by using "./". pagespec_match() has grown a new third parameter to support this. --- IkiWiki/Plugin/brokenlinks.pm | 2 +- IkiWiki/Plugin/inline.pm | 2 +- IkiWiki/Plugin/linkmap.pm | 2 +- IkiWiki/Plugin/lockedit.pm | 2 +- IkiWiki/Plugin/map.pm | 2 +- IkiWiki/Plugin/orphans.pm | 2 +- IkiWiki/Plugin/pagecount.pm | 2 +- IkiWiki/Plugin/pagestats.pm | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index a23436fd0..af2418ff4 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -20,7 +20,7 @@ sub preprocess (@) { #{{{ my @broken; foreach my $page (keys %links) { - if (pagespec_match($page, $params{pages})) { + if (pagespec_match($page, $params{pages}, $params{page})) { my $discussion=gettext("discussion"); foreach my $link (@{$links{$page}}) { next if $link =~ /.*\/\Q$discussion\E/i && $config{discussion}; diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 06b74b3fa..13876b56f 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -81,7 +81,7 @@ sub preprocess_inline (@) { #{{{ my @list; foreach my $page (keys %pagesources) { next if $page eq $params{page}; - if (pagespec_match($page, $params{pages})) { + if (pagespec_match($page, $params{pages}, $params{page})) { push @list, $page; } } diff --git a/IkiWiki/Plugin/linkmap.pm b/IkiWiki/Plugin/linkmap.pm index e0c5fb475..528d51697 100644 --- a/IkiWiki/Plugin/linkmap.pm +++ b/IkiWiki/Plugin/linkmap.pm @@ -48,7 +48,7 @@ sub genmap ($) { #{{{ # Get all the items to map. my %mapitems = (); foreach my $item (keys %links) { - if (pagespec_match($item, $params{pages})) { + if (pagespec_match($item, $params{pages}, $params{page})) { my $link=htmlpage($item); $link=IkiWiki::abs2rel($link, IkiWiki::dirname($params{page})); $mapitems{$item}=$link; diff --git a/IkiWiki/Plugin/lockedit.pm b/IkiWiki/Plugin/lockedit.pm index 587f7ee54..2b72fabe5 100644 --- a/IkiWiki/Plugin/lockedit.pm +++ b/IkiWiki/Plugin/lockedit.pm @@ -20,7 +20,7 @@ sub canedit ($$) { #{{{ return undef if defined $user && IkiWiki::is_admin($user); foreach my $admin (@{$config{adminuser}}) { - if (pagespec_match($page, IkiWiki::userinfo_get($admin, "locked_pages"))) { + if (pagespec_match($page, IkiWiki::userinfo_get($admin, "locked_pages"), "")) { return sprintf(gettext("%s is locked by %s and cannot be edited"), htmllink("", "", $page, 1), IkiWiki::userlink($admin)); diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm index 96daf39fc..3c41194f4 100644 --- a/IkiWiki/Plugin/map.pm +++ b/IkiWiki/Plugin/map.pm @@ -26,7 +26,7 @@ sub preprocess (@) { #{{{ # Get all the items to map. my @mapitems = (); foreach my $page (keys %links) { - if (pagespec_match($page, $params{pages})) { + if (pagespec_match($page, $params{pages}, $params{page})) { push @mapitems, $page; } } diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index def8e92d6..39d836a01 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -28,7 +28,7 @@ sub preprocess (@) { #{{{ my $discussion=gettext("discussion"); foreach my $page (keys %renderedfiles) { next if $linkedto{$page}; - next unless pagespec_match($page, $params{pages}); + next unless pagespec_match($page, $params{pages}, $params{page}); # If the page has a link to some other page, it's # indirectly linked to a page via that page's backlinks. next if grep { diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index 7ced15982..5ba7ee50b 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -22,7 +22,7 @@ sub preprocess (@) { #{{{ return $#pages+1 if $params{pages} eq "*"; # optimisation my $count=0; foreach my $page (@pages) { - $count++ if pagespec_match($page, $params{pages}); + $count++ if pagespec_match($page, $params{pages}, $params{page}); } return $count; } # }}} diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm index 79b3292c6..f9a54ab56 100644 --- a/IkiWiki/Plugin/pagestats.pm +++ b/IkiWiki/Plugin/pagestats.pm @@ -33,7 +33,7 @@ sub preprocess (@) { #{{{ my %counts; my $max = 0; foreach my $page (keys %links) { - if (pagespec_match($page, $params{pages})) { + if (pagespec_match($page, $params{pages}, $params{page})) { use IkiWiki::Render; my @bl = IkiWiki::backlinks($page); $counts{$page} = scalar(@bl); -- cgit v1.2.3