Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19059/lib/OpenInteract2
Modified Files:
Manage.pm
Log Message:
add _set_copy_file_status() and get rid of _create_sync_status() since nothing is using File::DirSync anymore
Index: Manage.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Manage.pm,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** Manage.pm 2 Feb 2005 13:15:04 -0000 1.44
--- Manage.pm 8 Feb 2005 01:09:13 -0000 1.45
***************
*** 470,477 ****
sub _fail {
my ( $self, $action, $msg, %additional ) = @_;
! $self->_add_status({ is_ok => 'no',
! action => $action,
! message => $msg,
! %additional });
return;
}
--- 470,479 ----
sub _fail {
my ( $self, $action, $msg, %additional ) = @_;
! $self->_add_status({
! is_ok => 'no',
! action => $action,
! message => $msg,
! %additional,
! });
return;
}
***************
*** 479,486 ****
sub _ok {
my ( $self, $action, $msg, %additional ) = @_;
! $self->_add_status({ is_ok => 'yes',
! action => $action,
! message => $msg,
! %additional });
return;
}
--- 481,490 ----
sub _ok {
my ( $self, $action, $msg, %additional ) = @_;
! $self->_add_status({
! is_ok => 'yes',
! action => $action,
! message => $msg,
! %additional,
! });
return;
}
***************
*** 517,560 ****
# Creates status entry with all files removed/skipped/updated
! sub _create_sync_status {
! my ( $self, $dirsync, $dir ) = @_;
! my %status = ();
! my @failed = $dirsync->entries_failed;
! if ( scalar @failed ) {
! %status = ( is_ok => 'no',
! message => "Following files from $dir had failures: " .
! join( ', ', @failed ) );
! }
! else {
! %status = ( is_ok => 'yes',
! message => "Mirrored $dir directory ok" );
! }
! my @updated = $dirsync->entries_updated;
! if ( scalar @updated ) {
! $status{updated} = "Updated items: " . join( ', ', @updated );
! }
! else {
! $status{updated} = 'No items updated';
! }
!
! my @removed = $dirsync->entries_removed;
! if ( scalar @removed ) {
! $status{removed} = "Removed items: " . join( ', ', @removed );
! }
! else {
! $status{removed} = 'No items removed';
}
!
! my @skipped = $dirsync->entries_skipped;
! if ( scalar @skipped ) {
! $status{skipped} = "Skipped items: " . join( ', ', @skipped );
}
! else {
! $status{skipped} = 'No items skipped';
}
- return \%status;
}
-
########################################
# FACTORY
--- 521,552 ----
# Creates status entry with all files removed/skipped/updated
! sub _set_copy_file_status {
! my ( $self, $status ) = @_;
! $status->{copied} ||= [];
! $status->{skipped} ||= [];
! $status->{same} ||= [];
! foreach my $file ( @{ $status->{copied} } ) {
! $self->_ok(
! 'copy updated template files',
! "File $file copied",
! filename => $file
! );
}
! foreach my $file ( @{ $status->{skipped} } ) {
! $self->_ok(
! 'copy updated template files',
! "File $file skipped, marked as read-only",
! filename => $file
! );
}
! foreach my $file ( @{ $status->{same} } ) {
! $self->_ok(
! 'copy updated template files',
! "File $file skipped, source and destination same",
! filename => $file
! );
}
}
########################################
# FACTORY
|