diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2015-04-16 16:40:14 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2015-04-16 16:40:14 -0300 |
commit | 22d005323f917d0189bcee8e6cbbbcf5906b2358 (patch) | |
tree | a2c3512f47b810dc79454f905642558ab4f57196 | |
parent | e2999abcd14540e66b72deeff75662c1672d7744 (diff) | |
download | postgresql-22d005323f917d0189bcee8e6cbbbcf5906b2358.tar.gz postgresql-22d005323f917d0189bcee8e6cbbbcf5906b2358.zip |
MSVC: install src/test/modules together with contrib
These modules have to be installed so that the testing module can access
them. (We don't have that yet, but will soon have it.)
Author: Michael Paquier
Reviewed by: Andrew Dunstan
-rw-r--r-- | src/tools/msvc/Install.pm | 154 |
1 files changed, 83 insertions, 71 deletions
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index 93a672498ab..bfcdf50e74a 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -432,98 +432,110 @@ sub CopyContribFiles my $target = shift; print "Copying contrib data files..."; - my $D; - opendir($D, 'contrib') || croak "Could not opendir on contrib!\n"; - while (my $d = readdir($D)) + foreach my $subdir ('contrib', 'src/test/modules') { - next if ($d =~ /^\./); - next unless (-f "contrib/$d/Makefile"); - next - if ($insttype eq "client" && !grep { $_ eq $d } @client_contribs); + my $D; + opendir($D, $subdir) || croak "Could not opendir on $subdir!\n"; + while (my $d = readdir($D)) + { + # These configuration-based exclusions must match vcregress.pl + next if ($d eq "uuid-ossp" && !defined($config->{uuid})); + next if ($d eq "sslinfo" && !defined($config->{openssl})); + next if ($d eq "xml2" && !defined($config->{xml})); + next if ($d eq "sepgsql"); - # these configuration-based exclusions must match vcregress.pl - next if ($d eq "uuid-ossp" && !defined($config->{uuid})); - next if ($d eq "sslinfo" && !defined($config->{openssl})); - next if ($d eq "xml2" && !defined($config->{xml})); - next if ($d eq "sepgsql"); + CopySubdirFiles($subdir, $d, $config, $target); + } + } + print "\n"; +} - my $mf = read_file("contrib/$d/Makefile"); - $mf =~ s{\\\r?\n}{}g; +sub CopySubdirFiles +{ + my $subdir = shift; + my $module = shift; + my $config = shift; + my $target = shift; - # Note: we currently don't support setting MODULEDIR in the makefile - my $moduledir = 'contrib'; + return if ($module =~ /^\./); + return unless (-f "$subdir/$module/Makefile"); + return + if ($insttype eq "client" && !grep { $_ eq $module } @client_contribs); - my $flist = ''; - if ($mf =~ /^EXTENSION\s*=\s*(.*)$/m) { $flist .= $1 } - if ($flist ne '') - { - $moduledir = 'extension'; - $flist = ParseAndCleanRule($flist, $mf); + my $mf = read_file("$subdir/$module/Makefile"); + $mf =~ s{\\\r?\n}{}g; - foreach my $f (split /\s+/, $flist) - { - lcopy( - 'contrib/' . $d . '/' . $f . '.control', - $target . '/share/extension/' . $f . '.control' - ) || croak("Could not copy file $f.control in contrib $d"); - print '.'; - } - } + # Note: we currently don't support setting MODULEDIR in the makefile + my $moduledir = 'contrib'; - $flist = ''; - if ($mf =~ /^DATA_built\s*=\s*(.*)$/m) { $flist .= $1 } - if ($mf =~ /^DATA\s*=\s*(.*)$/m) { $flist .= " $1" } - $flist =~ s/^\s*//; # Remove leading spaces if we had only DATA_built + my $flist = ''; + if ($mf =~ /^EXTENSION\s*=\s*(.*)$/m) { $flist .= $1 } + if ($flist ne '') + { + $moduledir = 'extension'; + $flist = ParseAndCleanRule($flist, $mf); - if ($flist ne '') + foreach my $f (split /\s+/, $flist) { - $flist = ParseAndCleanRule($flist, $mf); - - foreach my $f (split /\s+/, $flist) - { - lcopy('contrib/' . $d . '/' . $f, - $target . '/share/' . $moduledir . '/' . basename($f)) - || croak("Could not copy file $f in contrib $d"); + lcopy( + "$subdir/$module/$f.control", + "$target/share/extension/$f.control" + ) || croak("Could not copy file $f.control in contrib $module"); print '.'; - } } + } - $flist = ''; - if ($mf =~ /^DATA_TSEARCH\s*=\s*(.*)$/m) { $flist .= $1 } - if ($flist ne '') - { - $flist = ParseAndCleanRule($flist, $mf); + $flist = ''; + if ($mf =~ /^DATA_built\s*=\s*(.*)$/m) { $flist .= $1 } + if ($mf =~ /^DATA\s*=\s*(.*)$/m) { $flist .= " $1" } + $flist =~ s/^\s*//; # Remove leading spaces if we had only DATA_built - foreach my $f (split /\s+/, $flist) - { - lcopy('contrib/' . $d . '/' . $f, - $target . '/share/tsearch_data/' . basename($f)) - || croak("Could not copy file $f in contrib $d"); + if ($flist ne '') + { + $flist = ParseAndCleanRule($flist, $mf); + + foreach my $f (split /\s+/, $flist) + { + lcopy("$subdir/$module/$f", + "$target/share/$moduledir/" . basename($f)) + || croak("Could not copy file $f in contrib $module"); print '.'; - } } + } - $flist = ''; - if ($mf =~ /^DOCS\s*=\s*(.*)$/mg) { $flist .= $1 } - if ($flist ne '') + $flist = ''; + if ($mf =~ /^DATA_TSEARCH\s*=\s*(.*)$/m) { $flist .= $1 } + if ($flist ne '') + { + $flist = ParseAndCleanRule($flist, $mf); + + foreach my $f (split /\s+/, $flist) { - $flist = ParseAndCleanRule($flist, $mf); + lcopy("$subdir/$module/$f", + "$target/share/tsearch_data/" . basename($f)) + || croak("Could not copy file $f in $subdir $module"); + print '.'; + } + } + + $flist = ''; + if ($mf =~ /^DOCS\s*=\s*(.*)$/mg) { $flist .= $1 } + if ($flist ne '') + { + $flist = ParseAndCleanRule($flist, $mf); - # Special case for contrib/spi - $flist = + # Special case for contrib/spi + $flist = "autoinc.example insert_username.example moddatetime.example refint.example timetravel.example" - if ($d eq 'spi'); - foreach my $f (split /\s+/, $flist) - { - lcopy('contrib/' . $d . '/' . $f, - $target . '/doc/' . $moduledir . '/' . $f) - || croak("Could not copy file $f in contrib $d"); - print '.'; - } + if ($module eq 'spi'); + foreach my $f (split /\s+/, $flist) + { + lcopy("$subdir/$module/$f", + "$target/doc/$moduledir/$f") + || croak("Could not copy file $f in contrib $module"); + print '.'; } } - closedir($D); - print "\n"; } sub ParseAndCleanRule |