diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-10-17 20:21:42 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-10-17 20:45:03 -0400 |
commit | 6a955e86bb37b490f066886968ba8ba2c56907ef (patch) | |
tree | 06e19d91e09a7f3ea0676f7b67c9b9b4aa89b353 /IkiWiki/Plugin/po.pm | |
parent | 69a1ebce16debf8b0aeb61329ff26d235e248e7d (diff) | |
download | ikiwiki-6a955e86bb37b490f066886968ba8ba2c56907ef.tar ikiwiki-6a955e86bb37b490f066886968ba8ba2c56907ef.tar.gz |
fix logic error
This sometimes caused infinite recursion when rebuilding a wiki
with po files.
Diffstat (limited to 'IkiWiki/Plugin/po.pm')
-rw-r--r-- | IkiWiki/Plugin/po.pm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 5d0d9e79d..d9aa9bfda 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -394,23 +394,25 @@ sub change (@) { my $updated_po_files=0; # Refresh/create POT and PO files as needed. - # (But avoid doing so if they are in an underlay directory.) foreach my $file (grep {istranslatablefile($_)} @rendered) { my $masterfile=srcfile($file); my $page=pagename($file); my $updated_pot_file=0; + + # Avoid touching underlay files. + next if $masterfile ne "$config{srcdir}/$file"; + # Only refresh POT file if it does not exist, or if - # $pagesources{$page} was changed: don't if only the HTML was + # the source was changed: don't if only the HTML was # refreshed, e.g. because of a dependency. - if ($masterfile eq "$config{srcdir}/$file" && - ((grep { $_ eq $pagesources{$page} } @origneedsbuild) - || ! -e potfile($masterfile))) { + if ((grep { $_ eq $pagesources{$page} } @origneedsbuild) || + ! -e potfile($masterfile)) { refreshpot($masterfile); $updated_pot_file=1; } my @pofiles; foreach my $po (pofiles($masterfile)) { - next if ! $updated_pot_file && ! -e $po; + next if ! $updated_pot_file && -e $po; next if grep { $po=~/\Q$_\E/ } @{$config{underlaydirs}}; push @pofiles, $po; } |