* Improve code that ignores files in the underlaydir if the srcdir has a

file building the same page. Now it will work even if the extensions of
  the source files differ.
master
joey 2006-12-28 22:15:38 +00:00
parent 4381a2e9f7
commit 8323bc5214
4 changed files with 19 additions and 5 deletions

View File

@ -247,13 +247,16 @@ sub refresh () { #{{{
warn("skipping bad filename $_\n"); warn("skipping bad filename $_\n");
} }
else { else {
# Don't add files that are in the # Don't add pages that are in the
# srcdir. # srcdir.
$f=~s/^\Q$config{underlaydir}\E\/?//; $f=~s/^\Q$config{underlaydir}\E\/?//;
if (! -e "$config{srcdir}/$f" && if (! -e "$config{srcdir}/$f" &&
! -l "$config{srcdir}/$f") { ! -l "$config{srcdir}/$f") {
push @files, $f; my $page=pagename($f);
$exists{pagename($f)}=1; if (! $exists{$page}) {
push @files, $f;
$exists{$page}=1;
}
} }
} }
} }
@ -266,10 +269,10 @@ sub refresh () { #{{{
my @add; my @add;
foreach my $file (@files) { foreach my $file (@files) {
my $page=pagename($file); my $page=pagename($file);
$pagesources{$page}=$file;
if (! $oldpagemtime{$page}) { if (! $oldpagemtime{$page}) {
push @add, $file; push @add, $file;
$pagecase{lc $page}=$page; $pagecase{lc $page}=$page;
$pagesources{$page}=$file;
if ($config{getctime} && -e "$config{srcdir}/$file") { if ($config{getctime} && -e "$config{srcdir}/$file") {
$pagectime{$page}=rcs_getctime("$config{srcdir}/$file"); $pagectime{$page}=rcs_getctime("$config{srcdir}/$file");
} }

5
debian/changelog vendored
View File

@ -11,8 +11,11 @@ ikiwiki (1.37) UNRELEASED; urgency=low
suprising behavior when using a setup file and not uncommenting any RCS suprising behavior when using a setup file and not uncommenting any RCS
options. options.
* Fix some bugs in the commit email sending code. * Fix some bugs in the commit email sending code.
* Improve code that ignores files in the underlaydir if the srcdir has a
file building the same page. Now it will work even if the extensions of
the source files differ.
-- Joey Hess <joeyh@debian.org> Sun, 24 Dec 2006 00:51:11 -0500 -- Joey Hess <joeyh@debian.org> Thu, 28 Dec 2006 17:13:43 -0500
ikiwiki (1.36) unstable; urgency=low ikiwiki (1.36) unstable; urgency=low

View File

@ -1,3 +1,9 @@
If a file in the srcdir is removed, exposing a file in the underlaydir, If a file in the srcdir is removed, exposing a file in the underlaydir,
ikiwiki will not notice the change and rebuild it until the file in the ikiwiki will not notice the change and rebuild it until the file in the
underlaydir gets a mtime newer than the mtime the removed file had. underlaydir gets a mtime newer than the mtime the removed file had.
Relatedly, if there are two files with different extensions that build a
page with the same name, in a directory, ikiwiki will update the page
whenever either changes, using the changed one as the source. But if that
most recently changed one is removed, it won't rebuild the page using the
older one as the source.

View File

@ -230,3 +230,5 @@ that sort of thing. Where or how do I submit it for inclusion?
>> Until I fix that, you can avoid the one from the underlay directory by >> Until I fix that, you can avoid the one from the underlay directory by
>> setting `underlaydir` to point to an empty directory. --[[Joey]] >> setting `underlaydir` to point to an empty directory. --[[Joey]]
>> >>
>> Ok, fixed (in svn), it will now prefer files in the srcdir over files
>> in the underlaydir that build the same page, no matter what extension.