]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
force rebuild from pre 20100422
[git.ikiwiki.info.git] / IkiWiki.pm
index ba2c09c369956579175cf8dd50a0f5308923f05a..509f9ba2e721be581f65c9b5fbf5b0960b4f42c1 100644 (file)
@@ -1089,11 +1089,11 @@ sub htmllink ($$$;@) {
                        my $cgilink = "";
                        if (length $config{cgiurl}) {
                                $cgilink = "<a href=\"".
-                               cgiurl(
-                                       do => "create",
-                                       page => lc($link),
-                                       from => $lpage
-                               )."\" rel=\"nofollow\">?</a>";
+                                       cgiurl(
+                                               do => "create",
+                                               page => lc($link),
+                                               from => $lpage
+                                       )."\" rel=\"nofollow\">?</a>";
                        }
                        return "<span class=\"createlink\">$cgilink$linktext</span>"
                }
@@ -1818,10 +1818,12 @@ sub add_depends ($$;$) {
        foreach my $p (keys %pagesources) {
                my $r=$sub->($p, location => $page);
                my $i=$r->influences;
+               my $static=$r->influences_static;
                foreach my $k (keys %$i) {
+                       next unless $r || $static || $k eq $page;
                        $depends_simple{$page}{lc $k} |= $i->{$k};
                }
-               last if $r->influences_static;
+               last if $static;
        }
 
        $depends{$page}{$pagespec} |= $deptype;
@@ -2136,6 +2138,9 @@ sub pagespec_match_list ($$;@) {
                my $r=$sub->($p, %params, location => $page);
                error(sprintf(gettext("cannot match pages: %s"), $r))
                        if $r->isa("IkiWiki::ErrorReason");
+               unless ($r) {
+                       $r->remove_influence($p);
+               }
                $accum |= $r;
                if ($r) {
                        push @matches, $p;
@@ -2221,7 +2226,7 @@ sub merge_influences {
        my $anded=shift;
 
        if (! $anded || (($this || %{$this->[1]}) &&
-                       ($other || %{$other->[1]}))) {
+                        ($other || %{$other->[1]}))) {
                foreach my $influence (keys %{$other->[1]}) {
                        $this->[1]{$influence} |= $other->[1]{$influence};
                }
@@ -2232,6 +2237,13 @@ sub merge_influences {
        }
 }
 
+sub remove_influence {
+       my $this=shift;
+       my $torm=shift;
+
+       delete $this->[1]{$torm};
+}
+
 package IkiWiki::ErrorReason;
 
 our @ISA = 'IkiWiki::FailReason';
@@ -2245,7 +2257,7 @@ sub derel ($$) {
        if ($path =~ m!^\./!) {
                $from=~s#/?[^/]+$## if defined $from;
                $path=~s#^\./##;
-               $path="$from/$path" if length $from;
+               $path="$from/$path" if defined $from && length $from;
        }
 
        return $path;