Skip to content

Commit 3b1e04c

Browse files
committed
Fix generation of snowball_create.sql on msvc builds.
1 parent 862861e commit 3b1e04c

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

src/backend/snowball/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for src/backend/snowball
44
#
5-
# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.2 2007/08/25 01:06:24 tgl Exp $
5+
# $PostgreSQL: pgsql/src/backend/snowball/Makefile,v 1.3 2007/08/27 10:29:49 mha Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -64,7 +64,7 @@ LANGUAGES= \
6464
russian english \
6565
spanish spanish \
6666
swedish swedish \
67-
turkish turkish \
67+
turkish turkish
6868

6969

7070
SQLSCRIPT= snowball_create.sql

src/tools/msvc/Install.pm

Lines changed: 41 additions & 1 deletion
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.16 2007/06/12 11:07:34 mha Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.17 2007/08/27 10:29:49 mha Exp $
77
#
88
use strict;
99
use warnings;
@@ -64,6 +64,7 @@ sub Install
6464
);
6565
GenerateConversionScript($target);
6666
GenerateTimezoneFiles($target,$conf);
67+
GenerateTsearchFiles($target);
6768
CopyContribFiles($config,$target);
6869
CopyIncludeFiles($target);
6970

@@ -216,6 +217,45 @@ sub GenerateTimezoneFiles
216217
print "\n";
217218
}
218219

220+
sub GenerateTsearchFiles
221+
{
222+
my $target = shift;
223+
224+
print "Generating tsearch script...";
225+
my $F;
226+
my $tmpl = read_file('src/backend/snowball/snowball.sql.in');
227+
my $mf = read_file('src/backend/snowball/Makefile');
228+
$mf =~ s{\\\s*[\r\n]+}{}mg;
229+
$mf =~ /^LANGUAGES\s*=\s*(.*)$/m
230+
|| die "Could not find LANGUAGES line in snowball Makefile\n";
231+
my @pieces = split /\s+/,$1;
232+
open($F,">$target/share/snowball_create.sql")
233+
|| die "Could not write snowball_create.sql";
234+
print $F read_file('src/backend/snowball/snowball_func.sql.in');
235+
while ($#pieces > 0)
236+
{
237+
my $lang = shift @pieces || last;
238+
my $latlang = shift @pieces || last;
239+
my $txt = $tmpl;
240+
my $stop = '';
241+
242+
if (-s "src/backend/snowball/stopwords/$lang.stop") {
243+
$stop = ", StopWords=$lang";
244+
}
245+
246+
$txt =~ s#_LANGNAME_#${lang}#gs;
247+
$txt =~ s#_DICTNAME_#${lang}_stem#gs;
248+
$txt =~ s#_CFGNAME_#${lang}#gs;
249+
$txt =~ s#_LATDICTNAME_#${latlang}_stem#gs;
250+
$txt =~ s#_NONLATDICTNAME_#${lang}_stem#gs;
251+
$txt =~ s#_STOPWORDS_#$stop#gs;
252+
print $F $txt;
253+
print ".";
254+
}
255+
close($F);
256+
print "\n";
257+
}
258+
219259
sub CopyContribFiles
220260
{
221261
my $config = 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