@ -432,98 +432,110 @@ sub CopyContribFiles
my $ target = shift ;
my $ target = shift ;
print "Copying contrib data files..." ;
print "Copying contrib data files..." ;
my $ D ;
foreach my $ subdir ( 'contrib' , 'src/test/modules' )
opendir ( $ D , 'contrib' ) || croak "Could not opendir on contrib!\n" ;
while ( my $ d = readdir ( $ D ) )
{
{
next if ( $ d =~ /^\./ ) ;
my $ D ;
next unless ( - f "contrib/$d/Makefile" ) ;
opendir ( $ D , $ subdir ) || croak "Could not opendir on $subdir!\n" ;
next
while ( my $ d = readdir ( $ D ) )
if ( $ insttype eq "client" && ! grep { $ _ eq $ d } @ client_contribs ) ;
{
# 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
CopySubdirFiles ( $ subdir , $ d , $ config , $ target ) ;
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 } ) ) ;
print "\n" ;
next if ( $ d eq "sepgsql" ) ;
}
my $ mf = read_file ( "contrib/$d/Makefile" ) ;
sub CopySubdirFiles
$ mf =~ s{\\\r?\n} {}g ;
{
my $ subdir = shift ;
my $ module = shift ;
my $ config = shift ;
my $ target = shift ;
# Note: we currently don't support setting MODULEDIR in the makefile
return if ( $ module =~ /^\./ ) ;
my $ moduledir = 'contrib' ;
return unless ( - f "$subdir/$module/Makefile" ) ;
return
if ( $ insttype eq "client" && ! grep { $ _ eq $ module } @ client_contribs ) ;
my $ flist = '' ;
my $ mf = read_file ( "$subdir/$module/Makefile" ) ;
if ( $ mf =~ /^EXTENSION\s*=\s*(.*)$/m ) { $ flist . = $ 1 }
$ mf =~ s{\\\r?\n} {}g ;
if ( $ flist ne '' )
{
$ moduledir = 'extension' ;
$ flist = ParseAndCleanRule ( $ flist , $ mf ) ;
foreach my $ f ( split /\s+/ , $ flist )
# Note: we currently don't support setting MODULEDIR in the makefile
{
my $ moduledir = 'contrib' ;
lcopy (
'contrib/' . $ d . '/' . $ f . '.control' ,
$ target . '/share/extension/' . $ f . '.control'
) || croak ( "Could not copy file $f.control in contrib $d" ) ;
print '.' ;
}
}
$ flist = '' ;
my $ flist = '' ;
if ( $ mf =~ /^DATA_built\s*=\s*(.*)$/m ) { $ flist . = $ 1 }
if ( $ mf =~ /^EXTENSION\s*=\s*(.*)$/m ) { $ flist . = $ 1 }
if ( $ mf =~ /^DATA\s*=\s*(.*)$/m ) { $ flist . = " $1" }
if ( $ flist ne '' )
$ flist =~ s/^\s*// ; # Remove leading spaces if we had only DATA_built
{
$ moduledir = 'extension' ;
$ flist = ParseAndCleanRule ( $ flist , $ mf ) ;
if ( $ flist ne '' )
foreach my $ f ( split /\s+/ , $ flist )
{
{
$ flist = ParseAndCleanRule ( $ flist , $ mf ) ;
lcopy (
"$subdir/$module/$f.control" ,
foreach my $ f ( split /\s+/ , $ flist )
"$target/share/extension/$f.control"
{
) || croak ( "Could not copy file $f.control in contrib $module" ) ;
lcopy ( 'contrib/' . $ d . '/' . $ f ,
$ target . '/share/' . $ moduledir . '/' . basename ( $ f ) )
|| croak ( "Could not copy file $f in contrib $d" ) ;
print '.' ;
print '.' ;
}
}
}
}
$ flist = '' ;
$ flist = '' ;
if ( $ mf =~ /^DATA_TSEARCH\s*=\s*(.*)$/m ) { $ flist . = $ 1 }
if ( $ mf =~ /^DATA_built\s*=\s*(.*)$/m ) { $ flist . = $ 1 }
if ( $ flist ne '' )
if ( $ mf =~ /^DATA\s*=\s*(.*)$/m ) { $ flist . = " $1" }
{
$ flist =~ s/^\s*// ; # Remove leading spaces if we had only DATA_built
$ flist = ParseAndCleanRule ( $ flist , $ mf ) ;
foreach my $ f ( split /\s+/ , $ flist )
if ( $ flist ne '' )
{
{
lcopy ( 'contrib/' . $ d . '/' . $ f ,
$ flist = ParseAndCleanRule ( $ flist , $ mf ) ;
$ target . '/share/tsearch_data/' . basename ( $ f ) )
|| croak ( "Could not copy file $f in contrib $d" ) ;
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 '.' ;
print '.' ;
}
}
}
}
$ flist = '' ;
$ flist = '' ;
if ( $ mf =~ /^DOCS\s*=\s*(.*)$/mg ) { $ flist . = $ 1 }
if ( $ mf =~ /^DATA_TSEARCH\s*=\s*(.*)$/m ) { $ flist . = $ 1 }
if ( $ flist ne '' )
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
# Special case for contrib/spi
$ flist =
$ flist =
"autoinc.example insert_username.example moddatetime.example refint.example timetravel.example"
"autoinc.example insert_username.example moddatetime.example refint.example timetravel.example"
if ( $ d eq 'spi' ) ;
if ( $ module eq 'spi' ) ;
foreach my $ f ( split /\s+/ , $ flist )
foreach my $ f ( split /\s+/ , $ flist )
{
{
lcopy ( 'contrib/' . $ d . '/' . $ f ,
lcopy ( "$subdir/$module/$f" ,
$ target . '/doc/' . $ moduledir . '/' . $ f )
"$target/doc/$moduledir/$f" )
|| croak ( "Could not copy file $f in contrib $d" ) ;
|| croak ( "Could not copy file $f in contrib $module" ) ;
print '.' ;
print '.' ;
}
}
}
}
}
closedir ( $ D ) ;
print "\n" ;
}
}
sub ParseAndCleanRule
sub ParseAndCleanRule