@@ -, +, @@ + Modification in LangInstaller.pm to fix a bug when the -f param was not --- misc/translator/LangInstaller.pm | 6 +++--- misc/translator/tmpl_process3.pl | 21 ++++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) --- a/misc/translator/LangInstaller.pm +++ a/misc/translator/LangInstaller.pm @@ -338,7 +338,7 @@ sub install_tmpl { "-o $trans->{dir}/$self->{lang} ". "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " . ( - $files + @$files ? '-f ' . join ' -f ', @$files : '' ) @@ -363,7 +363,7 @@ sub update_tmpl { "-i $trans->{dir}/en/ " . "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " . ( - $files + @$files ? '-f ' . join ' -f ', @$files : '' ) @@ -398,7 +398,7 @@ sub create_tmpl { "-i $trans->{dir}/en/ " . "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r " . ( - $files + @$files ? '-f ' . join ' -f ', @$files : '' ) --- a/misc/translator/tmpl_process3.pl +++ a/misc/translator/tmpl_process3.pl @@ -146,7 +146,7 @@ sub listfiles { } elsif (-f $path) { my $basename = basename $path; push @it, $path - if ( not @$filenames or ( grep { $basename =~ /$_/ } @$filenames ) ) + if ( not @$filenames or ( grep { $path =~ /$_/ } @$filenames ) ) and (!defined $type || $dirent =~ /\.(?:$type)$/) || $action eq 'install'; } elsif (-d $path && $recursive_p) { push @it, listfiles($path, $type, $action, $filenames); @@ -371,13 +371,20 @@ if ($action eq 'create') { (defined $charset_in? ('-I', $charset_in): ()), (defined $charset_out? ('-O', $charset_out): ())); if ($st == 0) { - # Merge the temporary "pot file" with the specified po file ($str_file) - # FIXME: msgmerge(1) is a Unix dependency - # FIXME: need to check the return value - $st = system("msgmerge -U ".($quiet?'-q':'')." -s $str_file $tmpfile2"); + # Merge the temporary "pot file" with the specified po file ($str_file) + # FIXME: msgmerge(1) is a Unix dependency + # FIXME: need to check the return value + if ( @filenames ) { + my ($tmph3, $tmpfile3) = tmpnam(); + $st = system("msgcat $str_file $tmpfile2 > $tmpfile3"); + $st = system("msgmerge -U ".($quiet?'-q':'')." -s $str_file $tmpfile3") + unless $st; + } else { + $st = system("msgmerge -U ".($quiet?'-q':'')." -s $str_file $tmpfile2"); + } } else { - error_normal "Text extraction failed: $xgettext: $!\n", undef; - error_additional "Will not run msgmerge\n", undef; + error_normal "Text extraction failed: $xgettext: $!\n", undef; + error_additional "Will not run msgmerge\n", undef; } # unlink $tmpfile1 || warn_normal "$tmpfile1: unlink failed: $!\n", undef; # unlink $tmpfile2 || warn_normal "$tmpfile2: unlink failed: $!\n", undef; --