From: Chris W. <la...@us...> - 2005-02-26 04:14:32
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5298 Modified Files: SQLInstall.pm Log Message: OIN-134: tell the installer to process only certain structure files Index: SQLInstall.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/SQLInstall.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** SQLInstall.pm 25 Feb 2005 05:29:13 -0000 1.26 --- SQLInstall.pm 26 Feb 2005 04:14:18 -0000 1.27 *************** *** 166,170 **** sub install_structure { ! my ( $self ) = @_; my $pkg = $self->package; unless ( UNIVERSAL::isa( $self->package, 'OpenInteract2::Package' ) ) { --- 166,170 ---- sub install_structure { ! my ( $self, @restrict_files ) = @_; my $pkg = $self->package; unless ( UNIVERSAL::isa( $self->package, 'OpenInteract2::Package' ) ) { *************** *** 230,241 **** my $driver_name = $ds_info->{sql_install} || $ds_info->{driver_name}; ! my @files = $self->_massage_arrayref( $self->get_structure_file( $structure_set, $driver_name ) ); ! foreach my $structure_file ( @files ) { $log->info( "Processing structure file '$structure_file'" ); $self->_set_datasource( $structure_file, $ds_name ); - # XXX: Need to use File::Spec here? my ( $table_sql ); my $relative_file = "$STRUCT_DIR/$structure_file"; --- 230,247 ---- my $driver_name = $ds_info->{sql_install} || $ds_info->{driver_name}; ! my @all_files = $self->_massage_arrayref( $self->get_structure_file( $structure_set, $driver_name ) ); ! my %restrict_to_files = map { $_ => 1 } @restrict_files; ! foreach my $structure_file ( @all_files ) { ! if ( scalar @restrict_files ! and ! $restrict_to_files{ $structure_file } ) { ! $log->info( "Skipping file '$structure_file' since files ", ! "were specified and it's not in the list" ); ! next; ! } $log->info( "Processing structure file '$structure_file'" ); $self->_set_datasource( $structure_file, $ds_name ); my ( $table_sql ); my $relative_file = "$STRUCT_DIR/$structure_file"; *************** *** 830,833 **** --- 836,843 ---- # Do one at a time $installer->install_structure; + + # ..and restrict to processing a single file + $installer->install_structure( 'table-A.sql' ); + $installer->install_data; $installer->install_security; *************** *** 931,935 **** Returns: nothing. ! B<install_structure()> If you have needs that declaration cannot fill, you can install the --- 941,945 ---- Returns: nothing. ! B<install_structure( [ @restrict_to_files ] )> If you have needs that declaration cannot fill, you can install the *************** *** 939,942 **** --- 949,955 ---- section on customization below.) + If you do implement it note that, if they specify it, users will + expect that you only process files in C<@restrict_to_files>. + B<get_structure_set()> |