mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Fix generation of snowball_create.sql on msvc builds.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Makefile for src/backend/snowball
|
# Makefile for src/backend/snowball
|
||||||
#
|
#
|
||||||
# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.2 2007/08/25 01:06:24 tgl Exp $
|
# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.3 2007/08/27 10:29:49 mha Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ LANGUAGES= \
|
|||||||
russian english \
|
russian english \
|
||||||
spanish spanish \
|
spanish spanish \
|
||||||
swedish swedish \
|
swedish swedish \
|
||||||
turkish turkish \
|
turkish turkish
|
||||||
|
|
||||||
|
|
||||||
SQLSCRIPT= snowball_create.sql
|
SQLSCRIPT= snowball_create.sql
|
||||||
|
@ -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.16 2007/06/12 11:07:34 mha Exp $
|
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.17 2007/08/27 10:29:49 mha Exp $
|
||||||
#
|
#
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
@ -64,6 +64,7 @@ sub Install
|
|||||||
);
|
);
|
||||||
GenerateConversionScript($target);
|
GenerateConversionScript($target);
|
||||||
GenerateTimezoneFiles($target,$conf);
|
GenerateTimezoneFiles($target,$conf);
|
||||||
|
GenerateTsearchFiles($target);
|
||||||
CopyContribFiles($config,$target);
|
CopyContribFiles($config,$target);
|
||||||
CopyIncludeFiles($target);
|
CopyIncludeFiles($target);
|
||||||
|
|
||||||
@ -216,6 +217,45 @@ sub GenerateTimezoneFiles
|
|||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub GenerateTsearchFiles
|
||||||
|
{
|
||||||
|
my $target = shift;
|
||||||
|
|
||||||
|
print "Generating tsearch script...";
|
||||||
|
my $F;
|
||||||
|
my $tmpl = read_file('src/backend/snowball/snowball.sql.in');
|
||||||
|
my $mf = read_file('src/backend/snowball/Makefile');
|
||||||
|
$mf =~ s{\\\s*[\r\n]+}{}mg;
|
||||||
|
$mf =~ /^LANGUAGES\s*=\s*(.*)$/m
|
||||||
|
|| die "Could not find LANGUAGES line in snowball Makefile\n";
|
||||||
|
my @pieces = split /\s+/,$1;
|
||||||
|
open($F,">$target/share/snowball_create.sql")
|
||||||
|
|| die "Could not write snowball_create.sql";
|
||||||
|
print $F read_file('src/backend/snowball/snowball_func.sql.in');
|
||||||
|
while ($#pieces > 0)
|
||||||
|
{
|
||||||
|
my $lang = shift @pieces || last;
|
||||||
|
my $latlang = shift @pieces || last;
|
||||||
|
my $txt = $tmpl;
|
||||||
|
my $stop = '';
|
||||||
|
|
||||||
|
if (-s "src/backend/snowball/stopwords/$lang.stop") {
|
||||||
|
$stop = ", StopWords=$lang";
|
||||||
|
}
|
||||||
|
|
||||||
|
$txt =~ s#_LANGNAME_#${lang}#gs;
|
||||||
|
$txt =~ s#_DICTNAME_#${lang}_stem#gs;
|
||||||
|
$txt =~ s#_CFGNAME_#${lang}#gs;
|
||||||
|
$txt =~ s#_LATDICTNAME_#${latlang}_stem#gs;
|
||||||
|
$txt =~ s#_NONLATDICTNAME_#${lang}_stem#gs;
|
||||||
|
$txt =~ s#_STOPWORDS_#$stop#gs;
|
||||||
|
print $F $txt;
|
||||||
|
print ".";
|
||||||
|
}
|
||||||
|
close($F);
|
||||||
|
print "\n";
|
||||||
|
}
|
||||||
|
|
||||||
sub CopyContribFiles
|
sub CopyContribFiles
|
||||||
{
|
{
|
||||||
my $config = shift;
|
my $config = shift;
|
||||||
|
Reference in New Issue
Block a user