aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Youri/Submit/Action/Reorder.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-06-29 13:30:24 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-06-29 13:30:24 +0000
commit6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217 (patch)
tree7e5723a41d828799e9759547bfd72c0133ba297f /lib/Youri/Submit/Action/Reorder.pm
downloadmga-youri-submit-6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217.tar
mga-youri-submit-6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217.tar.gz
mga-youri-submit-6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217.tar.bz2
mga-youri-submit-6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217.tar.xz
mga-youri-submit-6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217.zip
prepare mergeupstream
Diffstat (limited to 'lib/Youri/Submit/Action/Reorder.pm')
-rw-r--r--lib/Youri/Submit/Action/Reorder.pm37
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;