Commit 02dec250 authored by Magnus Hagander's avatar Magnus Hagander

Read nls.nk files to determine the proper name of NLS catalogs to install.

Hiroshi Inoue, with minor modifications by me
parent ce53791b
...@@ -3,7 +3,7 @@ package Install; ...@@ -3,7 +3,7 @@ package Install;
# #
# Package that provides 'make install' functionality for msvc builds # 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 strict;
use warnings; use warnings;
...@@ -470,11 +470,10 @@ sub GenerateNLSFiles ...@@ -470,11 +470,10 @@ sub GenerateNLSFiles
}, "src"); }, "src");
foreach (@flist) foreach (@flist)
{ {
my $prgm = DetermineCatalogName($_);
s/nls.mk/po/; s/nls.mk/po/;
my $dir = $_; my $dir = $_;
next unless ($dir =~ /([^\/]+)\/po$/); next unless ($dir =~ /([^\/]+)\/po$/);
my $prgm = $1;
$prgm = 'postgres' if ($prgm eq 'backend');
foreach (glob("$dir/*.po")) foreach (glob("$dir/*.po"))
{ {
my $lang; my $lang;
...@@ -499,6 +498,15 @@ sub DetermineMajorVersion ...@@ -499,6 +498,15 @@ sub DetermineMajorVersion
return $1; 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 sub read_file
{ {
my $filename = shift; my $filename = shift;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment