@ -432,22 +432,37 @@ sub CopyContribFiles
my $ target = shift ;
print "Copying contrib data files..." ;
foreach my $ subdir ( 'contrib' , 'src/test/modules' )
{
my $ D ;
opendir ( $ D , 'contrib' ) || croak "Could not opendir on contrib!\n" ;
opendir ( $ D , $ subdir ) || croak "Could not opendir on $subdir !\n" ;
while ( my $ d = readdir ( $ D ) )
{
next if ( $ d =~ /^\./ ) ;
next unless ( - f "contrib/$d/Makefile" ) ;
next
if ( $ insttype eq "client" && ! grep { $ _ eq $ d } @ client_contribs ) ;
# these configuration-based exclusions must match vcregress.pl
# 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" ) ;
my $ mf = read_file ( "contrib/$d/Makefile" ) ;
CopySubdirFiles ( $ subdir , $ d , $ config , $ target ) ;
}
}
print "\n" ;
}
sub CopySubdirFiles
{
my $ subdir = shift ;
my $ module = shift ;
my $ config = shift ;
my $ target = shift ;
return if ( $ module =~ /^\./ ) ;
return unless ( - f "$subdir/$module/Makefile" ) ;
return
if ( $ insttype eq "client" && ! grep { $ _ eq $ module } @ client_contribs ) ;
my $ mf = read_file ( "$subdir/$module/Makefile" ) ;
$ mf =~ s{\\\r?\n} {}g ;
# Note: we currently don't support setting MODULEDIR in the makefile
@ -463,9 +478,9 @@ sub CopyContribFiles
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" ) ;
"$subdir/$module/$f.control" ,
"$target/share/extension/$f.control"
) || croak ( "Could not copy file $f.control in contrib $mo dule " ) ;
print '.' ;
}
}
@ -481,9 +496,9 @@ sub CopyContribFiles
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" ,
"$target/share/$moduledir/" . basename ( $ f ) )
|| croak ( "Could not copy file $f in contrib $mo dule " ) ;
print '.' ;
}
}
@ -496,9 +511,9 @@ sub CopyContribFiles
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 " ) ;
lcopy ( "$subdir/$module/$f" ,
"$target/share/tsearch_data/" . basename ( $ f ) )
|| croak ( "Could not copy file $f in $subdir $module " ) ;
print '.' ;
}
}
@ -512,18 +527,15 @@ sub CopyContribFiles
# Special case for contrib/spi
$ flist =
"autoinc.example insert_username.example moddatetime.example refint.example timetravel.example"
if ( $ d eq 'spi' ) ;
if ( $ mo dule 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" ) ;
lcopy ( "$subdir/$module/$f" ,
"$target/doc/$moduledir/$f" )
|| croak ( "Could not copy file $f in contrib $mo dule " ) ;
print '.' ;
}
}
}
closedir ( $ D ) ;
print "\n" ;
}
sub ParseAndCleanRule