X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/82ac63d798cc7f45a42e14bc2ad05a9388e25a04..9232e5df3b0f41dbaabe926a8b5b393be6ddf9cd:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 31e175d2a..8143f5256 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -643,7 +643,7 @@ sub preprocess ($$$;$$) { #{{{ return $ret; } else { - return "[[$command $params]]"; + return "\\[[$command $params]]"; } }; @@ -689,7 +689,6 @@ sub lockwiki (;$) { #{{{ error("wiki is locked; waited $wait seconds without lock being freed (possible stuck process or stale lock?)"); } else { - debug("wiki is locked"); return 0; } } @@ -747,9 +746,9 @@ sub loadindex () { #{{{ $depends{$page}=$items{depends}[0] if exists $items{depends}; $destsources{$_}=$page foreach @{$items{dest}}; $renderedfiles{$page}=[@{$items{dest}}]; - $oldrenderedfiles{$page}=[@{$items{dest}}]; $pagecase{lc $page}=$page; } + $oldrenderedfiles{$page}=[@{$items{dest}}]; $pagectime{$page}=$items{ctime}[0]; } close IN; @@ -1057,8 +1056,8 @@ sub match_glob ($$;@) { #{{{ # relative matching if ($glob =~ m!^\./!) { - $from=~s!/?[^/]+$!!; - $glob=~s!^\./!!; + $from=~s#/?[^/]+$##; + $glob=~s#^\./##; $glob="$from/$glob" if length $from; } @@ -1084,18 +1083,23 @@ sub match_link ($$;@) { #{{{ # relative matching if ($link =~ m!^\.! && defined $from) { - $from=~s!/?[^/]+$!!; - $link=~s!^\./!!; + $from=~s#/?[^/]+$##; + $link=~s#^\./##; $link="$from/$link" if length $from; } my $links = $IkiWiki::links{$page} or return undef; return IkiWiki::FailReason->new("$page has no links") unless @$links; my $bestlink = IkiWiki::bestlink($from, $link); - return IkiWiki::FailReason->new("no such link") unless length $bestlink; foreach my $p (@$links) { - return IkiWiki::SuccessReason->new("$page links to $link") - if $bestlink eq IkiWiki::bestlink($page, $p); + if (length $bestlink) { + return IkiWiki::SuccessReason->new("$page links to $link") + if $bestlink eq IkiWiki::bestlink($page, $p); + } + else { + return IkiWiki::SuccessReason->new("$page links to page matching $link") + if match_glob($p, $link, %params); + } } return IkiWiki::FailReason->new("$page does not link to $link"); } #}}}