X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/b1dade8d960ce7ccb549e5652d35a8e9dbccf5c6..66ecf1dba5d0aca59affd30029fe14ad5e3efc94:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 241fb45b7..6739ba56c 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -469,7 +469,7 @@ sub getsetup () { }, setuptype => { type => "internal", - default => "IkiWiki::Setup::Standard", + default => "Standard", description => "perl class to use to dump setup file", safe => 0, rebuild => 0, @@ -1796,7 +1796,7 @@ sub add_depends ($$;$) { # Add explicit dependencies for influences. my $sub=pagespec_translate($pagespec); - return if $@; + return unless defined $sub; foreach my $p (keys %pagesources) { my $r=$sub->($p, location => $page); my $i=$r->influences; @@ -2001,7 +2001,7 @@ sub pagespec_match ($$;@) { my $sub=pagespec_translate($spec); return IkiWiki::ErrorReason->new("syntax error in pagespec \"$spec\"") - if $@ || ! defined $sub; + if ! defined $sub; return $sub->($page, @params); } @@ -2019,7 +2019,7 @@ sub pagespec_match_list ($$;@) { my $sub=pagespec_translate($pagespec); error "syntax error in pagespec \"$pagespec\"" - if $@ || ! defined $sub; + if ! defined $sub; my @candidates; if (exists $params{list}) { @@ -2092,8 +2092,7 @@ sub pagespec_match_list ($$;@) { sub pagespec_valid ($) { my $spec=shift; - my $sub=pagespec_translate($spec); - return ! $@; + return defined pagespec_translate($spec); } sub glob2re ($) { @@ -2215,7 +2214,7 @@ sub match_link ($$;@) { my $from=exists $params{location} ? $params{location} : ''; my $links = $IkiWiki::links{$page}; - return IkiWiki::FailReason->new("$page has no links", "" => 1) + return IkiWiki::FailReason->new("$page has no links", $page => $IkiWiki::DEPEND_LINKS, "" => 1) unless $links && @{$links}; my $bestlink = IkiWiki::bestlink($from, $link); foreach my $p (@{$links}) { @@ -2232,7 +2231,7 @@ sub match_link ($$;@) { if match_glob($p_rel, $link, %params); } } - return IkiWiki::FailReason->new("$page does not link to $link", "" => 1); + return IkiWiki::FailReason->new("$page does not link to $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1); } sub match_backlink ($$;@) {