From 629968fc89bced6727981c0a1138072631751fee Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 18 Oct 2008 21:47:49 +0200 Subject: [PATCH] po plugin(refreshpot): prevent PO references to be written ... else we can fall into some kind of nasty infinite loop, when two ikiwiki instances don't store their working copy of the repository at the same place: every POT file update in one repository would trigger an update of the same POT file in the others repository, and so on. Signed-off-by: intrigeri --- IkiWiki/Plugin/po.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 07896d95a..26bd893a9 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -9,6 +9,7 @@ use strict; use IkiWiki 2.00; use Encode; use Locale::Po4a::Chooser; +use Locale::Po4a::Po; use File::Basename; use File::Copy; use File::Spec; @@ -119,6 +120,12 @@ sub refreshpot ($) { #{{{ $doc->{TT}{utf_mode} = 1; $doc->{TT}{file_in_charset} = 'utf-8'; $doc->{TT}{file_out_charset} = 'utf-8'; + # let's cheat a bit to force porefs option to be passed to Locale::Po4a::Po; + # this is undocument use of internal Locale::Po4a::TransTractor's data, + # compulsory since this module prevents us from using the porefs option. + my %po_options = ('porefs' => 'none'); + $doc->{TT}{po_out}=Locale::Po4a::Po->new(\%po_options); + # do the actual work $doc->parse; $doc->writepo($potfile); } #}}} -- 2.45.0