change how dependency types are specified to add_depends
Also, this fixes 2 bugs in dependency info.master
parent
f2b3d13414
commit
c57908b9d0
|
@ -24,7 +24,7 @@ sub preprocess (@) {
|
||||||
$params{pages}="*" unless defined $params{pages};
|
$params{pages}="*" unless defined $params{pages};
|
||||||
|
|
||||||
# Needs to update whenever the links on a page change.
|
# Needs to update whenever the links on a page change.
|
||||||
add_depends($params{page}, $params{pages}, links => 1);
|
add_depends($params{page}, $params{pages}, deptype("links"));
|
||||||
|
|
||||||
my @broken;
|
my @broken;
|
||||||
foreach my $link (keys %IkiWiki::brokenlinks) {
|
foreach my $link (keys %IkiWiki::brokenlinks) {
|
||||||
|
|
|
@ -105,21 +105,21 @@ sub format_month (@) {
|
||||||
linktext => " $monthname ");
|
linktext => " $monthname ");
|
||||||
}
|
}
|
||||||
add_depends($params{page}, "$archivebase/$year/".sprintf("%02d", $month),
|
add_depends($params{page}, "$archivebase/$year/".sprintf("%02d", $month),
|
||||||
presence => 1);
|
deptype("presence"));
|
||||||
if (exists $cache{$pagespec}{"$pyear/$pmonth"}) {
|
if (exists $cache{$pagespec}{"$pyear/$pmonth"}) {
|
||||||
$purl = htmllink($params{page}, $params{destpage},
|
$purl = htmllink($params{page}, $params{destpage},
|
||||||
"$archivebase/$pyear/" . sprintf("%02d", $pmonth),
|
"$archivebase/$pyear/" . sprintf("%02d", $pmonth),
|
||||||
linktext => " $pmonthname ");
|
linktext => " $pmonthname ");
|
||||||
}
|
}
|
||||||
add_depends($params{page}, "$archivebase/$pyear/".sprintf("%02d", $pmonth),
|
add_depends($params{page}, "$archivebase/$pyear/".sprintf("%02d", $pmonth),
|
||||||
presence => 1);
|
deptype("presence"));
|
||||||
if (exists $cache{$pagespec}{"$nyear/$nmonth"}) {
|
if (exists $cache{$pagespec}{"$nyear/$nmonth"}) {
|
||||||
$nurl = htmllink($params{page}, $params{destpage},
|
$nurl = htmllink($params{page}, $params{destpage},
|
||||||
"$archivebase/$nyear/" . sprintf("%02d", $nmonth),
|
"$archivebase/$nyear/" . sprintf("%02d", $nmonth),
|
||||||
linktext => " $nmonthname ");
|
linktext => " $nmonthname ");
|
||||||
}
|
}
|
||||||
add_depends($params{page}, "$archivebase/$nyear/".sprintf("%02d", $nmonth),
|
add_depends($params{page}, "$archivebase/$nyear/".sprintf("%02d", $nmonth),
|
||||||
presence => 1);
|
deptype("presence"));
|
||||||
|
|
||||||
# Start producing the month calendar
|
# Start producing the month calendar
|
||||||
$calendar=<<EOF;
|
$calendar=<<EOF;
|
||||||
|
@ -212,7 +212,7 @@ EOF
|
||||||
|
|
||||||
# Add dependencies to update the calendar whenever pages
|
# Add dependencies to update the calendar whenever pages
|
||||||
# matching the pagespec are added or removed.
|
# matching the pagespec are added or removed.
|
||||||
add_depends($params{page}, $params{pages}, presence => 1);
|
add_depends($params{page}, $params{pages}, deptype("presence"));
|
||||||
|
|
||||||
return $calendar;
|
return $calendar;
|
||||||
}
|
}
|
||||||
|
@ -244,19 +244,19 @@ sub format_year (@) {
|
||||||
"$archivebase/$year",
|
"$archivebase/$year",
|
||||||
linktext => "$year");
|
linktext => "$year");
|
||||||
}
|
}
|
||||||
add_depends($params{page}, "$archivebase/$year", presence => 1);
|
add_depends($params{page}, "$archivebase/$year", deptype("presence");
|
||||||
if (exists $cache{$pagespec}{"$pyear"}) {
|
if (exists $cache{$pagespec}{"$pyear"}) {
|
||||||
$purl = htmllink($params{page}, $params{destpage},
|
$purl = htmllink($params{page}, $params{destpage},
|
||||||
"$archivebase/$pyear",
|
"$archivebase/$pyear",
|
||||||
linktext => "\←");
|
linktext => "\←");
|
||||||
}
|
}
|
||||||
add_depends($params{page}, "$archivebase/$pyear", presence => 1);
|
add_depends($params{page}, "$archivebase/$pyear", deptype("presence"));
|
||||||
if (exists $cache{$pagespec}{"$nyear"}) {
|
if (exists $cache{$pagespec}{"$nyear"}) {
|
||||||
$nurl = htmllink($params{page}, $params{destpage},
|
$nurl = htmllink($params{page}, $params{destpage},
|
||||||
"$archivebase/$nyear",
|
"$archivebase/$nyear",
|
||||||
linktext => "\→");
|
linktext => "\→");
|
||||||
}
|
}
|
||||||
add_depends($params{page}, "$archivebase/$nyear", presence => 1);
|
add_depends($params{page}, "$archivebase/$nyear", deptype("presence"));
|
||||||
|
|
||||||
# Start producing the year calendar
|
# Start producing the year calendar
|
||||||
$calendar=<<EOF;
|
$calendar=<<EOF;
|
||||||
|
@ -308,7 +308,8 @@ EOF
|
||||||
else {
|
else {
|
||||||
$calendar.=qq{\t<td class="$tag">$monthabbr</td>\n};
|
$calendar.=qq{\t<td class="$tag">$monthabbr</td>\n};
|
||||||
}
|
}
|
||||||
add_depends($params{page}, "$archivebase/$year/$mtag", presence => 1);
|
add_depends($params{page}, "$archivebase/$year/$mtag",
|
||||||
|
deptype("presence"));
|
||||||
|
|
||||||
$calendar.=qq{\t</tr>\n} if ($month % $params{months_per_row} == 0);
|
$calendar.=qq{\t</tr>\n} if ($month % $params{months_per_row} == 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ sub preprocess (@) {
|
||||||
$pagestate{$params{page}}{edittemplate}{$params{match}}=$link;
|
$pagestate{$params{page}}{edittemplate}{$params{match}}=$link;
|
||||||
|
|
||||||
return "" if ($params{silent} && IkiWiki::yesno($params{silent}));
|
return "" if ($params{silent} && IkiWiki::yesno($params{silent}));
|
||||||
add_depends($params{page}, $link, presence => 1);
|
add_depends($params{page}, $link, deptype("presence"));
|
||||||
return sprintf(gettext("edittemplate %s registered for %s"),
|
return sprintf(gettext("edittemplate %s registered for %s"),
|
||||||
htmllink($params{page}, $params{destpage}, $link),
|
htmllink($params{page}, $params{destpage}, $link),
|
||||||
$params{match});
|
$params{match});
|
||||||
|
|
|
@ -195,9 +195,14 @@ sub preprocess_inline (@) {
|
||||||
|
|
||||||
@list = map { bestlink($params{page}, $_) }
|
@list = map { bestlink($params{page}, $_) }
|
||||||
split ' ', $params{pagenames};
|
split ' ', $params{pagenames};
|
||||||
|
|
||||||
|
foreach my $p (@list) {
|
||||||
|
add_depends($params{page}, $p, deptype($quick ? "presence" : "content"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
add_depends($params{page}, $params{pages}, presence => $quick);
|
add_depends($params{page}, $params{pages},
|
||||||
|
deptype($quick ? "presence" : "content"));
|
||||||
|
|
||||||
@list = pagespec_match_list(
|
@list = pagespec_match_list(
|
||||||
[ grep { $_ ne $params{page} } keys %pagesources ],
|
[ grep { $_ ne $params{page} } keys %pagesources ],
|
||||||
|
|
|
@ -30,7 +30,7 @@ sub preprocess (@) {
|
||||||
|
|
||||||
# Needs to update whenever a relevant page is added, or removed, or
|
# Needs to update whenever a relevant page is added, or removed, or
|
||||||
# its links change.
|
# its links change.
|
||||||
add_depends($params{page}, $params{pages}, presence => 1, links => 1);
|
add_depends($params{page}, $params{pages}, deptype("presence", "links"));
|
||||||
|
|
||||||
# Can't just return the linkmap here, since the htmlscrubber
|
# Can't just return the linkmap here, since the htmlscrubber
|
||||||
# scrubs out all <object> tags (with good reason!)
|
# scrubs out all <object> tags (with good reason!)
|
||||||
|
|
|
@ -84,7 +84,7 @@ sub preprocess (@) {
|
||||||
foreach my $plugin (@pluginlist) {
|
foreach my $plugin (@pluginlist) {
|
||||||
$result .= '<li class="listdirectives">';
|
$result .= '<li class="listdirectives">';
|
||||||
my $link=linkpage($config{directive_description_dir}."/".$plugin);
|
my $link=linkpage($config{directive_description_dir}."/".$plugin);
|
||||||
add_depends($params{page}, $link, presence => 1);
|
add_depends($params{page}, $link, deptype("presence"));
|
||||||
$result .= htmllink($params{page}, $params{destpage}, $link);
|
$result .= htmllink($params{page}, $params{destpage}, $link);
|
||||||
$result .= '</li>';
|
$result .= '</li>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,8 @@ sub preprocess (@) {
|
||||||
# Needs to update whenever a page is added or removed (or in some
|
# Needs to update whenever a page is added or removed (or in some
|
||||||
# cases, when its content changes, if show= is specified), so
|
# cases, when its content changes, if show= is specified), so
|
||||||
# register a dependency.
|
# register a dependency.
|
||||||
add_depends($params{page}, $params{pages}, presence => ! exists $params{show});
|
add_depends($params{page}, $params{pages},
|
||||||
|
deptype(exists $params{show} ? "content" : "presence");
|
||||||
|
|
||||||
# Create the map.
|
# Create the map.
|
||||||
my $parent="";
|
my $parent="";
|
||||||
|
|
|
@ -195,7 +195,7 @@ sub preprocess (@) {
|
||||||
if (! length $link) {
|
if (! length $link) {
|
||||||
error gettext("redir page not found")
|
error gettext("redir page not found")
|
||||||
}
|
}
|
||||||
add_depends($page, $link, presence => 1);
|
add_depends($page, $link, deptype("presence"));
|
||||||
|
|
||||||
$value=urlto($link, $page);
|
$value=urlto($link, $page);
|
||||||
$value.='#'.$redir_anchor if defined $redir_anchor;
|
$value.='#'.$redir_anchor if defined $redir_anchor;
|
||||||
|
|
|
@ -26,10 +26,10 @@ sub preprocess (@) {
|
||||||
# Needs to update whenever a link changes, on any page
|
# Needs to update whenever a link changes, on any page
|
||||||
# since any page could link to one of the pages we're
|
# since any page could link to one of the pages we're
|
||||||
# considering as orphans.
|
# considering as orphans.
|
||||||
add_depends($params{page}, "*", links => 1);
|
add_depends($params{page}, "*", deptype("links"));
|
||||||
# Also needs to update whenever potential orphans are added or
|
# Also needs to update whenever potential orphans are added or
|
||||||
# removed.
|
# removed.
|
||||||
add_depends($params{page}, $params{pages}, presence => 1);
|
add_depends($params{page}, $params{pages}, deptype("presence"));
|
||||||
|
|
||||||
my @orphans;
|
my @orphans;
|
||||||
foreach my $page (pagespec_match_list(
|
foreach my $page (pagespec_match_list(
|
||||||
|
|
|
@ -24,7 +24,7 @@ sub preprocess (@) {
|
||||||
|
|
||||||
# Needs to update count whenever a page is added or removed, so
|
# Needs to update count whenever a page is added or removed, so
|
||||||
# register a presence dependency.
|
# register a presence dependency.
|
||||||
add_depends($params{page}, $params{pages}, presence => 1);
|
add_depends($params{page}, $params{pages}, deptype("presence"));
|
||||||
|
|
||||||
my @pages;
|
my @pages;
|
||||||
if ($params{pages} eq "*") {
|
if ($params{pages} eq "*") {
|
||||||
|
|
|
@ -36,12 +36,12 @@ sub preprocess (@) {
|
||||||
my $style = ($params{style} or 'cloud');
|
my $style = ($params{style} or 'cloud');
|
||||||
|
|
||||||
# Needs to update whenever a page is added or removed.
|
# Needs to update whenever a page is added or removed.
|
||||||
add_depends($params{page}, $params{pages}, exists => 1);
|
add_depends($params{page}, $params{pages}, deptype("presence"));
|
||||||
# Also needs to update when any page with links changes,
|
# Also needs to update when any page with links changes,
|
||||||
# in case the links point to our displayed pages.
|
# in case the links point to our displayed pages.
|
||||||
# (Among limits this further.)
|
# (Among limits this further.)
|
||||||
add_depends($params{page}, exists $params{among} ? $params{among} : "*",
|
add_depends($params{page}, exists $params{among} ? $params{among} : "*",
|
||||||
links => 1);
|
deptype("links"));
|
||||||
|
|
||||||
my %counts;
|
my %counts;
|
||||||
my $max = 0;
|
my $max = 0;
|
||||||
|
|
|
@ -48,7 +48,7 @@ sub preprocess (@) {
|
||||||
error gettext("unknown formula");
|
error gettext("unknown formula");
|
||||||
}
|
}
|
||||||
|
|
||||||
add_depends($params{page}, $params{pages}, presence => 1);
|
add_depends($params{page}, $params{pages}, deptype("presence"));
|
||||||
|
|
||||||
my @list=sort { $params{timehash}->{$b} <=> $params{timehash}->{$a} }
|
my @list=sort { $params{timehash}->{$b} <=> $params{timehash}->{$a} }
|
||||||
pagespec_match_list(
|
pagespec_match_list(
|
||||||
|
|
|
@ -36,8 +36,8 @@ sub preprocess (@) {
|
||||||
$fill.="%";
|
$fill.="%";
|
||||||
}
|
}
|
||||||
elsif (defined $params{totalpages} and defined $params{donepages}) {
|
elsif (defined $params{totalpages} and defined $params{donepages}) {
|
||||||
add_depends($params{page}, $params{totalpages}, presence => 1);
|
add_depends($params{page}, $params{totalpages}, deptype("presence"));
|
||||||
add_depends($params{page}, $params{donepages}, presence => 1);
|
add_depends($params{page}, $params{donepages}, deptype("presence"));
|
||||||
|
|
||||||
my @pages=keys %pagesources;
|
my @pages=keys %pagesources;
|
||||||
my $totalcount=0;
|
my $totalcount=0;
|
||||||
|
|
Loading…
Reference in New Issue