From: Chris W. <la...@us...> - 2005-01-28 14:01:17
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16832 Modified Files: Setup.pm Log Message: OIN-123: fall back on good old string eval to create the without() routine Index: Setup.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Setup.pm,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Setup.pm 26 Jan 2005 02:35:56 -0000 1.57 --- Setup.pm 28 Jan 2005 14:00:25 -0000 1.58 *************** *** 5,9 **** use strict; use base qw( Class::Factory ); - use Algorithm::Dependency; use Algorithm::Dependency::Ordered; use Log::Log4perl qw( get_logger ); --- 5,8 ---- *************** *** 141,154 **** } if ( scalar @skip_actions ) { $ordered_names = $class->remove_skip_actions( @skip_actions ); } ! my @setups = (); foreach my $name ( @{ $ordered_names } ) { ! push @setups, OpenInteract2::Setup->new( $name ); ! } ! $log->info( "Created ", scalar( @setups ), " setup objects ok" ); ! ! foreach my $setup ( @setups ) { $setup->run( $ctx ); } } --- 140,153 ---- } if ( scalar @skip_actions ) { + $log->info( "Removing these actions and dependencies: ", + join( ', ', @skip_actions ) ); $ordered_names = $class->remove_skip_actions( @skip_actions ); } ! $log->info( "Running the following setup actions, in order: ", ! join( ', ', @{ $ordered_names } ) ); foreach my $name ( @{ $ordered_names } ) { ! my $setup = OpenInteract2::Setup->new( $name ); $setup->run( $ctx ); + $log->debug( "Ran setup action '$name' ok" ); } } *************** *** 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; --- 179,216 ---- $DEFAULT_DEPENDENCY = OpenInteract2::Setup::ReadServerConfig->get_name; ! # This subroutine has been submitted as a patch to A::D but not yet ! # accepted/released; once it is we'll just change the dependency ! # version in Build.PL/Makefile.PL and get rid of this. ! ! { ! require Algorithm::Dependency; ! if ( Algorithm::Dependency->VERSION <= 1.03 ) { ! eval <<'WITHOUT'; ! ! sub Algorithm::Dependency::without { ! 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 = (); ! ! ITEM: ! foreach my $item ( @{ $all_items } ) { ! next ITEM if ( $to_skip{ $item } ); ! my $all_item_dep = $self->depends( $item ); ! foreach my $item_dep ( @{ $all_item_dep } ) { ! next ITEM if ( $to_skip{ $item_dep } ); ! } ! push @good_items, $item; ! } ! return \@good_items; ! } ! WITHOUT ! ! } ! } 1; |