From: Chris W. <la...@us...> - 2005-01-26 02:37:47
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32604/lib/OpenInteract2 Modified Files: Context.pm Manage.pm Setup.pm Log Message: fix website creation problems spawned by recent ::Setup change Index: Context.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Context.pm,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** Context.pm 25 Jan 2005 04:26:43 -0000 1.80 --- Context.pm 26 Jan 2005 02:35:50 -0000 1.81 *************** *** 147,152 **** push @skip, $params->{skip}; } } - my $base_config = $self->base_config; unless ( $base_config and --- 147,152 ---- push @skip, $params->{skip}; } + $log_init->info( "Will skip setup tasks: ", join( ', ', @skip ) ); } my $base_config = $self->base_config; unless ( $base_config and *************** *** 161,165 **** # context in a decent state ! OpenInteract2::Setup->run_all_actions( $self, \@skip ); $log_init->info( "Initialized context ok" ); --- 161,165 ---- # context in a decent state ! OpenInteract2::Setup->run_all_actions( $self, @skip ); $log_init->info( "Initialized context ok" ); Index: Manage.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage.pm,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Manage.pm 24 Jan 2005 16:58:38 -0000 1.42 --- Manage.pm 26 Jan 2005 02:35:55 -0000 1.43 *************** *** 76,87 **** eval { $self->run_task }; my $error = $@; ! if ( $@ ) { $self->notify_observers( progress => 'Failed task' ); ! $self->param( 'task_failed', 'yes' ); } $self->tear_down_task; chdir( $pwd ); if ( $error ) { ! oi_error $@; } $self->notify_observers( progress => 'Task complete' ); --- 76,88 ---- eval { $self->run_task }; my $error = $@; ! if ( $error ) { $self->notify_observers( progress => 'Failed task' ); ! $self->param( task_failed => 'yes' ); ! $self->param( task_error => "$error" ); } $self->tear_down_task; chdir( $pwd ); if ( $error ) { ! oi_error $error; } $self->notify_observers( progress => 'Task complete' ); *************** *** 491,495 **** sub _setup_context { ! my ( $self, @params ) = @_; my $website_dir = $self->param( 'website_dir' ); unless ( -d $website_dir ) { --- 492,500 ---- sub _setup_context { ! my ( $self, $params ) = @_; ! my $log = get_logger(); ! if ( $self->param( 'debug' ) ) { ! $log->level( $DEBUG ); ! } my $website_dir = $self->param( 'website_dir' ); unless ( -d $website_dir ) { *************** *** 497,506 **** "directory '$website_dir'"; } my $base_config = OpenInteract2::Config::Base->new({ ! website_dir => $website_dir }); ! if ( $self->param( 'debug' ) ) { ! get_logger()->level( $DEBUG ); ! } ! OpenInteract2::Context->create( $base_config, @params ); } --- 502,511 ---- "directory '$website_dir'"; } + $log->info( "Website directory '$website_dir' exists, setting up context..." ); my $base_config = OpenInteract2::Config::Base->new({ ! website_dir => $website_dir ! }); ! OpenInteract2::Context->create( $base_config, $params ); ! $log->info( "Context setup for management task(s) ok" ); } Index: Setup.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Setup.pm,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Setup.pm 24 Jan 2005 17:24:31 -0000 1.56 --- Setup.pm 26 Jan 2005 02:35:56 -0000 1.57 *************** *** 5,8 **** --- 5,9 ---- use strict; use base qw( Class::Factory ); + use Algorithm::Dependency; use Algorithm::Dependency::Ordered; use Log::Log4perl qw( get_logger ); *************** *** 160,171 **** "with 'OpenInteract2::Context->create(...)'"; } ! my $actions = $DEP->schedule( $run_action ); $log->info( "Asked to run setup for '$run_action', will execute ", "actions (including deps): ", join( ', ', @{ $actions } ) ); foreach my $action ( @{ $actions } ) { my $setup = OpenInteract2::Setup->new( $action ); - $setup->run_pre_process( CTX ); $setup->run( CTX ); - $setup->run_post_process( CTX ); } } --- 161,170 ---- "with 'OpenInteract2::Context->create(...)'"; } ! my $actions = $DEP->schedule( $run_action ) || []; $log->info( "Asked to run setup for '$run_action', will execute ", "actions (including deps): ", join( ', ', @{ $actions } ) ); foreach my $action ( @{ $actions } ) { my $setup = OpenInteract2::Setup->new( $action ); $setup->run( CTX ); } } *************** *** 181,209 **** $DEFAULT_DEPENDENCY = OpenInteract2::Setup::ReadServerConfig->get_name; ! { ! no strict; ! if ( Algorithm::Dependency->VERSION <= 1.03 ) { ! *Algorithm::Dependency::without = sub { ! my $self = shift; ! my @without = @_; ! my $all_items = $self->schedule_all(); ! unless ( scalar @without ) { ! return $all_items; ! } ! my %to_skip = map { $_ => 1 } @without; ! my @good_items = (); ! ! foreach my $item ( @{ $all_items } ) { ! next if ( $to_skip{ $item } ); ! my $all_item_dep = $self->depends( $item ); ! foreach my $item_dep ( @{ $all_item_dep } ) { ! next if ( $to_skip{ $item_dep } ); ! } ! push @good_items, $item; ! } ! return \@good_items; ! }; ! } ! } 1; --- 180,209 ---- $DEFAULT_DEPENDENCY = OpenInteract2::Setup::ReadServerConfig->get_name; ! # See about adding this... ! #{ ! # no strict; ! # if ( Algorithm::Dependency->VERSION <= 1.03 ) { ! # *Algorithm::Dependency::without = sub { ! # my $self = shift; ! # my @without = @_; ! # my $all_items = $self->schedule_all(); ! # unless ( scalar @without ) { ! # return $all_items; ! # } ! # my %to_skip = map { $_ => 1 } @without; ! # my @good_items = (); ! # ! # foreach my $item ( @{ $all_items } ) { ! # next if ( $to_skip{ $item } ); ! # my $all_item_dep = $self->depends( $item ); ! # foreach my $item_dep ( @{ $all_item_dep } ) { ! # next if ( $to_skip{ $item_dep } ); ! # } ! # push @good_items, $item; ! # } ! # return \@good_items; ! # }; ! # } ! #} 1; |