Skip to content

Commit 02dec25

Browse files
committed
Read nls.nk files to determine the proper name of NLS catalogs to install.
Hiroshi Inoue, with minor modifications by me
1 parent ce53791 commit 02dec25

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/tools/msvc/Install.pm

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package Install;
33
#
44
# Package that provides 'make install' functionality for msvc builds
55
#
6-
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.32 2009/01/21 09:25:11 mha Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.33 2009/04/20 08:38:00 mha Exp $
77
#
88
use strict;
99
use warnings;
@@ -470,11 +470,10 @@ sub GenerateNLSFiles
470470
}, "src");
471471
foreach (@flist)
472472
{
473+
my $prgm = DetermineCatalogName($_);
473474
s/nls.mk/po/;
474475
my $dir = $_;
475476
next unless ($dir =~ /([^\/]+)\/po$/);
476-
my $prgm = $1;
477-
$prgm = 'postgres' if ($prgm eq 'backend');
478477
foreach (glob("$dir/*.po"))
479478
{
480479
my $lang;
@@ -499,6 +498,15 @@ sub DetermineMajorVersion
499498
return $1;
500499
}
501500

501+
sub DetermineCatalogName
502+
{
503+
my $filename = shift;
504+
505+
my $f = read_file($filename) || croak "Could not open $filename";
506+
$f =~ /CATALOG_NAME\s*\:?=\s*(\S+)/m || croak "Could not determine catalog name in $filename";
507+
return $1;
508+
}
509+
502510
sub read_file
503511
{
504512
my $filename = shift;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy