diff options
Diffstat (limited to 'lib/Youri/Submit/Action/Clean.pm')
-rw-r--r-- | lib/Youri/Submit/Action/Clean.pm | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/Youri/Submit/Action/Clean.pm b/lib/Youri/Submit/Action/Clean.pm new file mode 100644 index 0000000..110326a --- /dev/null +++ b/lib/Youri/Submit/Action/Clean.pm @@ -0,0 +1,42 @@ +# $Id: Clean.pm 1689 2007-06-28 22:44:24Z guillomovitch $ +package Youri::Submit::Action::Clean; + +=head1 NAME + +Youri::Submit::Action::Clean - Old revisions cleanup + +=head1 DESCRIPTION + +This action plugin ensures cleanup of old package revisions. + +=cut + +use warnings; +use strict; +use Carp; +use base qw/Youri::Submit::Step/; + +sub process_packages { + my ($self, $packages, $repository, $target, $context) = @_; + croak "Not a class method" unless ref $self; + + foreach my $package (@$packages) { + foreach my $replaced_package ( + $repository->get_replaced_packages($package, $target, $define) + ) { + my $file = $replaced_package->as_file(); + print "deleting file $file\n" if $self->{_verbose}; + unlink $file unless $self->{_test}; + } + } +} + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2002-2006, YOURI project + +This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. + +=cut + +1; |