]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
fix handling of influences of pagespecs that fail to match
[ikiwiki.git] / IkiWiki.pm
index 39a43ddbec4854261fafff1c9e12021b9e45db3e..2064c881a5497a3de1a15f28029d2f810218623e 100644 (file)
@@ -1789,8 +1789,8 @@ sub add_depends ($$;@) {
        }
 
        # Analyse the pagespec, and match it against all pages
-       # to get a list of influences, and add explicit 
-       # content dependencies for those.
+       # to get a list of influences, and add explicit dependencies
+       # for those.
        my $sub=pagespec_translate($pagespec);
        return if $@;
        foreach my $p (keys %pagesources) {
@@ -2025,7 +2025,13 @@ sub new {
 }
 
 sub influences {
-       return %{$_[0][1]};
+       my $this=shift;
+       if (! @_) {
+               return %{$this->[1]};
+       }
+       else {
+               $this->[1]={@_};
+       }
 }
 
 sub merge_influences {
@@ -2089,7 +2095,7 @@ sub match_link ($$;@) {
        my $from=exists $params{location} ? $params{location} : '';
 
        my $links = $IkiWiki::links{$page};
-       return IkiWiki::FailReason->new("$page has no links", $page => $IkiWiki::DEPEND_LINKS)
+       return IkiWiki::FailReason->new("$page has no links")
                unless $links && @{$links};
        my $bestlink = IkiWiki::bestlink($from, $link);
        foreach my $p (@{$links}) {
@@ -2106,11 +2112,13 @@ sub match_link ($$;@) {
                                if match_glob($p_rel, $link, %params);
                }
        }
-       return IkiWiki::FailReason->new("$page does not link to $link", $page => $IkiWiki::DEPEND_LINKS);
+       return IkiWiki::FailReason->new("$page does not link to $link");
 }
 
 sub match_backlink ($$;@) {
-       return match_link($_[1], $_[0], @_);
+       my $ret=match_link($_[1], $_[0], @_);
+       $ret->influences($_[1] => $IkiWiki::DEPEND_LINKS);
+       return $ret;
 }
 
 sub match_created_before ($$;@) {