aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-06-09 14:33:49 -0400
committerJoey Hess <joey@kitenet.net>2010-06-09 14:39:17 -0400
commitcdf4292846e6fe0fb877809ef0906ff6bddf6bf9 (patch)
treec79c9fa5cfe8eee1f44aecd1f0843c6b5d7be319
parentba9b808c898a556541057ac9f524db2de2a33d77 (diff)
downloadikiwiki-cdf4292846e6fe0fb877809ef0906ff6bddf6bf9.tar
ikiwiki-cdf4292846e6fe0fb877809ef0906ff6bddf6bf9.tar.gz
Fix support for globbing in tagged() pagespecs.
The linktype check was being done on the relativised link target, but %typedlinks uses the same link targets as %links, so that didn't work. I think the bug only appeared when tagbase was not set. This bugfix also let me factor out the common typedlink checking code.
-rw-r--r--IkiWiki.pm8
-rw-r--r--debian/changelog1
-rw-r--r--doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn1
3 files changed, 7 insertions, 3 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index e2a3d216f..27fa4ca17 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -2397,18 +2397,20 @@ sub match_link ($$;@) {
unless $links && @{$links};
my $bestlink = IkiWiki::bestlink($from, $link);
foreach my $p (@{$links}) {
+ next unless (! defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p});
+
if (length $bestlink) {
- if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}) && $bestlink eq IkiWiki::bestlink($page, $p)) {
+ if ($bestlink eq IkiWiki::bestlink($page, $p)) {
return IkiWiki::SuccessReason->new("$page links to $link$qualifier", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
}
}
else {
- if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}) && match_glob($p, $link, %params)) {
+ if (match_glob($p, $link, %params)) {
return IkiWiki::SuccessReason->new("$page links to page $p$qualifier, matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
}
my ($p_rel)=$p=~/^\/?(.*)/;
$link=~s/^\///;
- if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p_rel}) && match_glob($p_rel, $link, %params)) {
+ if (match_glob($p_rel, $link, %params)) {
return IkiWiki::SuccessReason->new("$page links to page $p_rel$qualifier, matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
}
}
diff --git a/debian/changelog b/debian/changelog
index a0ea9c156..38beca395 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ ikiwiki (3.20100518.3) UNRELEASED; urgency=low
* img: Fill in missing height or width when scaling image.
* Remove example blog tag pages; allow autotag creation to create them
when used.
+ * Fix support for globbing in tagged() pagespecs.
-- Joey Hess <joeyh@debian.org> Mon, 31 May 2010 20:44:17 -0400
diff --git a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn
index 9a55c0673..fba332949 100644
--- a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn
+++ b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn
@@ -29,4 +29,5 @@ I did not yet do any testing to figure out when this broke.
>> --[[tschwinge]]
>>> Only way I can reproduce something like this is if tagbase is not set.
+>>> I have fixed a bug there, see if it works for you?
>>> --[[Joey]]