Fix msvc install script to properly install NLS files when built with

gettext.
This commit is contained in:
Magnus Hagander 2008-02-07 13:49:00 +00:00
parent fa0dc92fd8
commit 26351d1c74
1 changed files with 8 additions and 8 deletions

View File

@ -3,7 +3,7 @@ package Install;
#
# Package that provides 'make install' functionality for msvc builds
#
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.26 2007/12/03 15:42:58 mha Exp $
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.27 2008/02/07 13:49:00 mha Exp $
#
use strict;
use warnings;
@ -456,27 +456,27 @@ sub GenerateNLSFiles
print "Installing NLS files...";
EnsureDirectories($target, "share/locale");
my @flist;
File::Find::find({wanted =>
sub { /^nls\.mk\z/s &&
! push(@flist, $File::Find::name);
}
File::Find::find({wanted =>
sub { /^nls\.mk\z/s &&
!push(@flist, $File::Find::name);
}
}, "src");
foreach (@flist)
{
s/nls.mk/po/;
my $dir = $_;
next unless ($dir =~ /([^\\]+)\\po$/);
next unless ($dir =~ /([^\/]+)\/po$/);
my $prgm = $1;
$prgm = 'postgres' if ($prgm eq 'backend');
foreach (glob("$dir/*.po"))
{
my $lang;
next unless /^(.*)\.po/;
next unless /([^\/]+)\.po/;
$lang = $1;
EnsureDirectories($target, "share/locale/$lang", "share/locale/$lang/LC_MESSAGES");
system(
"$nlspath\\bin\\msgfmt -o $target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm.mo $dir\\$_"
"$nlspath\\bin\\msgfmt -o $target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm.mo $_"
)
&& croak("Could not run msgfmt on $dir\\$_");
print ".";