]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Fix support for globbing in tagged() pagespecs.
authorJoey Hess <joey@kitenet.net>
Wed, 9 Jun 2010 18:33:49 +0000 (14:33 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 9 Jun 2010 18:39:17 +0000 (14:39 -0400)
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.

IkiWiki.pm
debian/changelog
doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn

index e2a3d216f4b09a1872792374b3d87cdba8fc58dd..27fa4ca17dd3a17fa6768acb5e496758a3eb55a7 100644 (file)
@@ -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)
                        }
                }
index a0ea9c1561ab77ed11e1a9aebcde709187902a85..38beca3951501237bd39f4a56c927d9f31e8dd75 100644 (file)
@@ -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
 
index 9a55c06733d748b71f513878530f4cf207980a0d..fba332949ee94a7fb56e8def61203a1c7838d0f1 100644 (file)
@@ -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]]