Skip to content

Commit fd6913a

Browse files
committed
perltidy run over msvc build system
1 parent 912bc4f commit fd6913a

File tree

5 files changed

+90
-87
lines changed

5 files changed

+90
-87
lines changed

src/tools/msvc/Install.pm

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ sub Install
5656
my $majorver = DetermineMajorVersion();
5757
print "Installing version $majorver for $conf in $target\n";
5858

59-
EnsureDirectories($target, 'bin', 'lib', 'share', 'share/timezonesets',
60-
'share/extension', 'share/contrib',
61-
'doc', 'doc/extension', 'doc/contrib',
62-
'symbols', 'share/tsearch_data');
59+
EnsureDirectories(
60+
$target, 'bin', 'lib', 'share',
61+
'share/timezonesets','share/extension', 'share/contrib','doc',
62+
'doc/extension', 'doc/contrib','symbols', 'share/tsearch_data'
63+
);
6364

6465
CopySolutionOutput($conf, $target);
6566
lcopy($target . '/lib/libpq.dll', $target . '/bin/libpq.dll');
@@ -113,11 +114,11 @@ sub Install
113114
CopyContribFiles($config,$target);
114115
CopyIncludeFiles($target);
115116

116-
my $pl_extension_files = [];
117-
my @pldirs = ('src/pl/plpgsql/src');
118-
push @pldirs,"src/pl/plperl" if $config->{perl};
119-
push @pldirs,"src/pl/plpython" if $config->{python};
120-
push @pldirs,"src/pl/tcl" if $config->{tcl};
117+
my $pl_extension_files = [];
118+
my @pldirs = ('src/pl/plpgsql/src');
119+
push @pldirs,"src/pl/plperl" if $config->{perl};
120+
push @pldirs,"src/pl/plpython" if $config->{python};
121+
push @pldirs,"src/pl/tcl" if $config->{tcl};
121122
File::Find::find(
122123
{
123124
wanted =>sub {
@@ -127,10 +128,7 @@ sub Install
127128
},
128129
@pldirs
129130
);
130-
CopySetOfFiles(
131-
'PL Extension files', $pl_extension_files,
132-
$target . '/share/extension/'
133-
);
131+
CopySetOfFiles('PL Extension files', $pl_extension_files,$target . '/share/extension/');
134132

135133
GenerateNLSFiles($target,$config->{nls},$majorver) if ($config->{nls});
136134

@@ -350,9 +348,10 @@ sub CopyContribFiles
350348

351349
foreach my $f (split /\s+/,$flist)
352350
{
353-
lcopy('contrib/' . $d . '/' . $f . '.control',
354-
$target . '/share/extension/' . $f . '.control')
355-
|| croak("Could not copy file $f.control in contrib $d");
351+
lcopy(
352+
'contrib/' . $d . '/' . $f . '.control',
353+
$target . '/share/extension/' . $f . '.control'
354+
)|| croak("Could not copy file $f.control in contrib $d");
356355
print '.';
357356
}
358357
}
@@ -369,7 +368,7 @@ sub CopyContribFiles
369368
foreach my $f (split /\s+/,$flist)
370369
{
371370
lcopy('contrib/' . $d . '/' . $f,
372-
$target . '/share/' . $moduledir . '/' . basename($f))
371+
$target . '/share/' . $moduledir . '/' . basename($f))
373372
|| croak("Could not copy file $f in contrib $d");
374373
print '.';
375374
}
@@ -383,8 +382,7 @@ sub CopyContribFiles
383382

384383
foreach my $f (split /\s+/,$flist)
385384
{
386-
lcopy('contrib/' . $d . '/' . $f,
387-
$target . '/share/tsearch_data/' . basename($f))
385+
lcopy('contrib/' . $d . '/' . $f,$target . '/share/tsearch_data/' . basename($f))
388386
|| croak("Could not copy file $f in contrib $d");
389387
print '.';
390388
}
@@ -402,8 +400,7 @@ sub CopyContribFiles
402400
if ($d eq 'spi');
403401
foreach my $f (split /\s+/,$flist)
404402
{
405-
lcopy('contrib/' . $d . '/' . $f,
406-
$target . '/doc/' . $moduledir . '/' . $f)
403+
lcopy('contrib/' . $d . '/' . $f,$target . '/doc/' . $moduledir . '/' . $f)
407404
|| croak("Could not copy file $f in contrib $d");
408405
print '.';
409406
}
@@ -473,14 +470,14 @@ sub CopyIncludeFiles
473470
$target . '/include/server/',
474471
'src/include/', 'pg_config.h', 'pg_config_os.h'
475472
);
476-
CopyFiles('Grammar header', $target . '/include/server/parser/',
477-
'src/backend/parser/', 'gram.h');
473+
CopyFiles('Grammar header', $target . '/include/server/parser/','src/backend/parser/',
474+
'gram.h');
478475
CopySetOfFiles('',[ glob("src\\include\\*.h") ],$target . '/include/server/');
479476
my $D;
480477
opendir($D, 'src/include') || croak "Could not opendir on src/include!\n";
481478

482-
# some xcopy progs don't like mixed slash style paths
483-
(my $ctarget = $target) =~ s!/!\\!g;
479+
# some xcopy progs don't like mixed slash style paths
480+
(my $ctarget = $target) =~ s!/!\\!g;
484481
while (my $d = readdir($D))
485482
{
486483
next if ($d =~ /^\./);

src/tools/msvc/Mkvcbuild.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ sub mkvcbuild
172172

173173
if ($solution->{options}->{python})
174174
{
175+
175176
# Attempt to get python version and location.
176177
# Assume python.exe in specified dir.
177178
open(P,
@@ -190,8 +191,8 @@ sub mkvcbuild
190191
if (!(defined($pyprefix) && defined($pyver)));
191192

192193
my $pymajorver = substr($pyver, 0, 1);
193-
my $plpython = $solution->AddProject('plpython' . $pymajorver, 'dll',
194-
'PLs', 'src\pl\plpython');
194+
my $plpython =
195+
$solution->AddProject('plpython' . $pymajorver, 'dll','PLs', 'src\pl\plpython');
195196
$plpython->AddIncludeDir($pyprefix . '\include');
196197
$plpython->AddLibrary($pyprefix . "\\Libs\\python$pyver.lib");
197198
$plpython->AddReference($postgres);

src/tools/msvc/Solution.pm

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,23 +273,30 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
273273
);
274274
}
275275

276-
if ($self->{options}->{python} && IsNewer('src\pl\plpython\spiexceptions.h','src\include\backend\errcodes.txt'))
276+
if ($self->{options}->{python}
277+
&& IsNewer('src\pl\plpython\spiexceptions.h','src\include\backend\errcodes.txt'))
277278
{
278279
print "Generating spiexceptions.h...\n";
279-
system('perl src\pl\plpython\generate-spiexceptions.pl src\backend\utils\errcodes.txt > src\pl\plpython\spiexceptions.h');
280+
system(
281+
'perl src\pl\plpython\generate-spiexceptions.pl src\backend\utils\errcodes.txt > src\pl\plpython\spiexceptions.h'
282+
);
280283
}
281284

282285
if (IsNewer('src\include\utils\errcodes.h','src\backend\utils\errcodes.txt'))
283286
{
284287
print "Generating errcodes.h...\n";
285-
system('perl src\backend\utils\generate-errcodes.pl src\backend\utils\errcodes.txt > src\backend\utils\errcodes.h');
288+
system(
289+
'perl src\backend\utils\generate-errcodes.pl src\backend\utils\errcodes.txt > src\backend\utils\errcodes.h'
290+
);
286291
copyFile('src\backend\utils\errcodes.h','src\include\utils\errcodes.h');
287292
}
288293

289294
if (IsNewer('src\pl\plpgsql\src\plerrcodes.h','src\backend\utils\errcodes.txt'))
290295
{
291296
print "Generating plerrcodes.h...\n";
292-
system('perl src\pl\plpgsql\src\generate-plerrcodes.pl src\backend\utils\errcodes.txt > src\pl\plpgsql\src\plerrcodes.h');
297+
system(
298+
'perl src\pl\plpgsql\src\generate-plerrcodes.pl src\backend\utils\errcodes.txt > src\pl\plpgsql\src\plerrcodes.h'
299+
);
293300
}
294301

295302
if (IsNewer('src\interfaces\libpq\libpq.rc','src\interfaces\libpq\libpq.rc.in'))

src/tools/msvc/builddoc.pl

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use File::Copy;
1010
use Cwd qw(abs_path getcwd);
1111

12-
1312
my $startdir = getcwd();
1413

1514
my $openjade = 'openjade-1.3.1';
@@ -27,60 +26,60 @@
2726
my @notfound;
2827
foreach my $dir ('docbook', $openjade, $dsssl)
2928
{
30-
push(@notfound,$dir) unless -d "$docroot/$dir";
29+
push(@notfound,$dir) unless -d "$docroot/$dir";
3130
}
3231
missing() if @notfound;
3332

3433
my $arg = shift;
3534
renamefiles();
3635

37-
3836
chdir 'doc/src/sgml';
3937

40-
$ENV{SGML_CATALOG_FILES} = "$docroot/$openjade/dsssl/catalog;" .
41-
"$docroot/docbook/docbook.cat";
38+
$ENV{SGML_CATALOG_FILES} = "$docroot/$openjade/dsssl/catalog;" ."$docroot/docbook/docbook.cat";
4239

4340
my $cmd;
4441

4542
# openjade exits below with a harmless non-zero status, so we
4643
# can't die on "failure"
4744

4845
$cmd =
49-
"perl mk_feature_tables.pl YES " .
50-
"../../../src/backend/catalog/sql_feature_packages.txt " .
51-
"../../../src/backend/catalog/sql_features.txt " .
52-
"> features-supported.sgml";
53-
system($cmd); die "features_supported" if $?;
54-
$cmd =
55-
"perl mk_feature_tables.pl NO " .
56-
"\"../../../src/backend/catalog/sql_feature_packages.txt\" " .
57-
"\"../../../src/backend/catalog/sql_features.txt\" " .
58-
"> features-unsupported.sgml";
59-
system($cmd); die "features_unsupported" if $?;
46+
"perl mk_feature_tables.pl YES "
47+
."../../../src/backend/catalog/sql_feature_packages.txt "
48+
."../../../src/backend/catalog/sql_features.txt "
49+
."> features-supported.sgml";
50+
system($cmd);
51+
die "features_supported" if $?;
6052
$cmd =
61-
"perl generate-errcodes-table.pl \"../../../src/backend/utils/errcodes.txt\" " .
62-
"> errcodes-table.sgml";
63-
system($cmd); die "errcodes-table" if $?;
53+
"perl mk_feature_tables.pl NO "
54+
."\"../../../src/backend/catalog/sql_feature_packages.txt\" "
55+
."\"../../../src/backend/catalog/sql_features.txt\" "
56+
."> features-unsupported.sgml";
57+
system($cmd);
58+
die "features_unsupported" if $?;
59+
$cmd ="perl generate-errcodes-table.pl \"../../../src/backend/utils/errcodes.txt\" "
60+
."> errcodes-table.sgml";
61+
system($cmd);
62+
die "errcodes-table" if $?;
6463

6564
print "Running first build...\n";
6665
$cmd =
67-
"\"$docroot/$openjade/bin/openjade\" -V html-index -wall " .
68-
"-wno-unused-param -wno-empty -D . -c \"$docroot/$dsssl/catalog\" " .
69-
"-d stylesheet.dsl -i output-html -t sgml postgres.sgml 2>&1 " .
70-
"| findstr /V \"DTDDECL catalog entries are not supported\" ";
66+
"\"$docroot/$openjade/bin/openjade\" -V html-index -wall "
67+
."-wno-unused-param -wno-empty -D . -c \"$docroot/$dsssl/catalog\" "
68+
."-d stylesheet.dsl -i output-html -t sgml postgres.sgml 2>&1 "
69+
."| findstr /V \"DTDDECL catalog entries are not supported\" ";
7170
system($cmd); # die "openjade" if $?;
7271
print "Running collateindex...\n";
73-
$cmd =
74-
"perl \"$docroot/$dsssl/bin/collateindex.pl\" -f -g -i bookindex " .
75-
"-o bookindex.sgml HTML.index";
76-
system($cmd); die "collateindex" if $?;
72+
$cmd ="perl \"$docroot/$dsssl/bin/collateindex.pl\" -f -g -i bookindex "
73+
."-o bookindex.sgml HTML.index";
74+
system($cmd);
75+
die "collateindex" if $?;
7776
mkdir "html";
7877
print "Running second build...\n";
7978
$cmd =
80-
"\"$docroot/$openjade/bin/openjade\" -wall -wno-unused-param -wno-empty " .
81-
"-D . -c \"$docroot/$dsssl/catalog\" -d stylesheet.dsl -t sgml " .
82-
"-i output-html -i include-index postgres.sgml 2>&1 " .
83-
"| findstr /V \"DTDDECL catalog entries are not supported\" ";
79+
"\"$docroot/$openjade/bin/openjade\" -wall -wno-unused-param -wno-empty "
80+
."-D . -c \"$docroot/$dsssl/catalog\" -d stylesheet.dsl -t sgml "
81+
."-i output-html -i include-index postgres.sgml 2>&1 "
82+
."| findstr /V \"DTDDECL catalog entries are not supported\" ";
8483

8584
system($cmd); # die "openjade" if $?;
8685

@@ -94,29 +93,29 @@
9493

9594
sub renamefiles
9695
{
97-
# Rename ISO entity files
98-
my $savedir = getcwd();
99-
chdir "$docroot/docbook";
100-
foreach my $f (glob('ISO*'))
101-
{
102-
next if $f =~ /\.gml$/i;
103-
my $nf = $f;
104-
$nf =~ s/ISO(.*)/ISO-$1.gml/;
105-
move $f, $nf;
106-
}
107-
chdir $savedir;
108-
96+
97+
# Rename ISO entity files
98+
my $savedir = getcwd();
99+
chdir "$docroot/docbook";
100+
foreach my $f (glob('ISO*'))
101+
{
102+
next if $f =~ /\.gml$/i;
103+
my $nf = $f;
104+
$nf =~ s/ISO(.*)/ISO-$1.gml/;
105+
move $f, $nf;
106+
}
107+
chdir $savedir;
108+
109109
}
110110

111111
sub missing
112112
{
113-
print STDERR "could not find $docroot/$_\n" foreach (@notfound);
114-
exit 1;
113+
print STDERR "could not find $docroot/$_\n" foreach (@notfound);
114+
exit 1;
115115
}
116116

117117
sub noversion
118118
{
119-
print STDERR "Could not find version.sgml. ",
120-
"Please run mkvcbuild.pl first!\n";
121-
exit 1;
119+
print STDERR "Could not find version.sgml. ","Please run mkvcbuild.pl first!\n";
120+
exit 1;
122121
}

src/tools/msvc/vcregress.pl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
INSTALLCHECK => \&installcheck,
7373
ECPGCHECK => \&ecpgcheck,
7474
CONTRIBCHECK => \&contribcheck,
75-
ISOLATIONCHECK => \&isolationcheck,
75+
ISOLATIONCHECK => \&isolationcheck,
7676
);
7777

7878
my $proc = $command{$what};
@@ -140,14 +140,13 @@ sub ecpgcheck
140140

141141
sub isolationcheck
142142
{
143-
chdir "../isolation";
144-
copy("../../../$Config/isolationtester/isolationtester.exe",".");
143+
chdir "../isolation";
144+
copy("../../../$Config/isolationtester/isolationtester.exe",".");
145145
my @args = (
146-
"../../../$Config/pg_isolation_regress/pg_isolation_regress",
147-
"--psqldir=../../../$Config/psql",
148-
"--inputdir=.",
149-
"--schedule=./isolation_schedule"
150-
);
146+
"../../../$Config/pg_isolation_regress/pg_isolation_regress",
147+
"--psqldir=../../../$Config/psql",
148+
"--inputdir=.","--schedule=./isolation_schedule"
149+
);
151150
push(@args,$maxconn) if $maxconn;
152151
system(@args);
153152
my $status = $? >>8;

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