sub scan ($) {
my $file=shift;
- return if $scanned{$file};
+ return if $phase > PHASE_SCAN || $scanned{$file};
$scanned{$file}=1;
debug(sprintf(gettext("scanning %s"), $file));
}
$pagecase{lc $page}=$page;
if (! exists $pagectime{$page}) {
- $pagectime{$page}=(srcfile_stat($file))[10];
+ my $ctime=(srcfile_stat($file, 1))[10];
+ $pagectime{$page}=$ctime if defined $ctime;
}
}
}
my @internal_changed;
foreach my $file (@$files) {
my $page=pagename($file);
- my ($srcfile, @stat)=srcfile_stat($file);
- if (! exists $pagemtime{$page} ||
- $stat[9] > $pagemtime{$page} ||
- $forcerebuild{$page}) {
+ my ($srcfile, @stat)=srcfile_stat($file, 1);
+ if (defined $srcfile &&
+ (! exists $pagemtime{$page} ||
+ $stat[9] > $pagemtime{$page} ||
+ $forcerebuild{$page})) {
$pagemtime{$page}=$stat[9];
if (isinternal($page)) {
# At this point it becomes OK to start matching pagespecs.
$phase = PHASE_RENDER;
+ # Save some memory: we no longer need to keep track of which pages
+ # we've scanned
+ %scanned = ();
remove_del(@$del, @$internal_del);