my @new;
my @internal_new;
+ my $times_noted;
+
foreach my $file (@$files) {
my $page=pagename($file);
if (exists $pagesources{$page} && $pagesources{$page} ne $file) {
if (isinternal($page)) {
push @internal_new, $file;
}
- else {
+ elsif ($config{rcs}) {
push @new, $file;
- if ($config{getctime} && -e "$config{srcdir}/$file") {
+ if ($config{gettime} && -e "$config{srcdir}/$file") {
+ if (! $times_noted) {
+ debug(sprintf(gettext("querying %s for file creation and modification times.."), $config{rcs}));
+ $times_noted=1;
+ }
+
eval {
- my $time=rcs_getctime("$config{srcdir}/$file");
- $pagectime{$page}=$time;
+ my $ctime=rcs_getctime("$config{srcdir}/$file");
+ if ($ctime > 0) {
+ $pagectime{$page}=$ctime;
+ }
};
if ($@) {
print STDERR $@;
}
+ my $mtime;
+ eval {
+ $mtime=rcs_getmtime("$config{srcdir}/$file");
+ };
+ if ($@) {
+ print STDERR $@;
+ }
+ elsif ($mtime > 0) {
+ utime($mtime, $mtime, "$config{srcdir}/$file");
+ }
}
}
$pagecase{lc $page}=$page;
foreach my $file (@_) {
my $page=pagename($file);
if (! isinternal($page)) {
- debug(sprintf(gettext("removing old page %s"), $page));
+ debug(sprintf(gettext("removing obsolete %s"), $page));
}
foreach my $old (@{$oldrenderedfiles{$page}}) {
my $old = shift;
return 0 if !defined $new && !defined $old;
- return 1 if !defined $new || !defined $old;
+ return 1 if (!defined $new && %$old) || (!defined $old && %$new);
while (my ($type, $links) = each %$new) {
foreach my $link (keys %$links) {
if ($type == $IkiWiki::DEPEND_LINKS) {
next unless $linkchangers->{lc($page)};
}
- return $page;
+ $reason=$page;
+ return 1;
}
}
return undef;
};
if ($depends{$p}{$dep} & $IkiWiki::DEPEND_CONTENT) {
- last if $reason =
- $in->(\@changed, $IkiWiki::DEPEND_CONTENT);
- last if $internal_dep && ($reason =
+ last if $in->(\@changed, $IkiWiki::DEPEND_CONTENT);
+ last if $internal_dep && (
$in->($internal_new, $IkiWiki::DEPEND_CONTENT) ||
$in->($internal_del, $IkiWiki::DEPEND_CONTENT) ||
- $in->($internal_changed, $IkiWiki::DEPEND_CONTENT));
+ $in->($internal_changed, $IkiWiki::DEPEND_CONTENT)
+ );
}
if ($depends{$p}{$dep} & $IkiWiki::DEPEND_PRESENCE) {
- last if $reason =
- $in->(\@exists_changed, $IkiWiki::DEPEND_PRESENCE);
- last if $internal_dep && ($reason =
+ last if $in->(\@exists_changed, $IkiWiki::DEPEND_PRESENCE);
+ last if $internal_dep && (
$in->($internal_new, $IkiWiki::DEPEND_PRESENCE) ||
- $in->($internal_del, $IkiWiki::DEPEND_PRESENCE));
+ $in->($internal_del, $IkiWiki::DEPEND_PRESENCE)
+ );
}
if ($depends{$p}{$dep} & $IkiWiki::DEPEND_LINKS) {
- last if $reason =
- $in->(\@changed, $IkiWiki::DEPEND_LINKS);
- last if $internal_dep && ($reason =
+ last if $in->(\@changed, $IkiWiki::DEPEND_LINKS);
+ last if $internal_dep && (
$in->($internal_new, $IkiWiki::DEPEND_LINKS) ||
$in->($internal_del, $IkiWiki::DEPEND_LINKS) ||
- $in->($internal_changed, $IkiWiki::DEPEND_LINKS));
+ $in->($internal_changed, $IkiWiki::DEPEND_LINKS)
+ );
}
}
}