diff options
Diffstat (limited to 'lib/Youri/Submit/Action/Reorder.pm')
-rw-r--r-- | lib/Youri/Submit/Action/Reorder.pm | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/Youri/Submit/Action/Reorder.pm b/lib/Youri/Submit/Action/Reorder.pm new file mode 100644 index 0000000..a6ed3da --- /dev/null +++ b/lib/Youri/Submit/Action/Reorder.pm @@ -0,0 +1,37 @@ +# $Id: Reorder.pm 1688 2007-06-28 22:44:16Z guillomovitch $ +package Youri::Submit::Action::Reorder; + +=head1 NAME + +Youri::Submit::Action::Reorder - Reorder packages with source first + +=head1 DESCRIPTION + +This action ensures that the source package is the first in the list. + +=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; + + $packages = [ + grep { $_->is_source() } @$packages, + grep { !$_->is_source() } @$packages, + ]; +} + +=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; |