Read nls.nk files to determine the proper name of NLS catalogs to install.
Hiroshi Inoue, with minor modifications by me
This commit is contained in:
parent
ce53791b2a
commit
02dec25003
@ -3,7 +3,7 @@ package Install;
|
||||
#
|
||||
# Package that provides 'make install' functionality for msvc builds
|
||||
#
|
||||
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.32 2009/01/21 09:25:11 mha Exp $
|
||||
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.33 2009/04/20 08:38:00 mha Exp $
|
||||
#
|
||||
use strict;
|
||||
use warnings;
|
||||
@ -470,11 +470,10 @@ sub GenerateNLSFiles
|
||||
}, "src");
|
||||
foreach (@flist)
|
||||
{
|
||||
my $prgm = DetermineCatalogName($_);
|
||||
s/nls.mk/po/;
|
||||
my $dir = $_;
|
||||
next unless ($dir =~ /([^\/]+)\/po$/);
|
||||
my $prgm = $1;
|
||||
$prgm = 'postgres' if ($prgm eq 'backend');
|
||||
foreach (glob("$dir/*.po"))
|
||||
{
|
||||
my $lang;
|
||||
@ -499,6 +498,15 @@ sub DetermineMajorVersion
|
||||
return $1;
|
||||
}
|
||||
|
||||
sub DetermineCatalogName
|
||||
{
|
||||
my $filename = shift;
|
||||
|
||||
my $f = read_file($filename) || croak "Could not open $filename";
|
||||
$f =~ /CATALOG_NAME\s*\:?=\s*(\S+)/m || croak "Could not determine catalog name in $filename";
|
||||
return $1;
|
||||
}
|
||||
|
||||
sub read_file
|
||||
{
|
||||
my $filename = shift;
|
||||
|
Loading…
Reference in New Issue
Block a user