aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo De Nardin <spuk@mandriva.org>2007-11-30 19:29:24 +0000
committerGustavo De Nardin <spuk@mandriva.org>2007-11-30 19:29:24 +0000
commit35d5ababc9c11a82f669ac2343a64a72dec3250d (patch)
treea76982b2d5a0450b66fdc229aaa21645fff893a7
parent07e6082413615ae76f6e2a2f4b01c97fcb15d151 (diff)
downloadmga-youri-submit-35d5ababc9c11a82f669ac2343a64a72dec3250d.tar
mga-youri-submit-35d5ababc9c11a82f669ac2343a64a72dec3250d.tar.gz
mga-youri-submit-35d5ababc9c11a82f669ac2343a64a72dec3250d.tar.bz2
mga-youri-submit-35d5ababc9c11a82f669ac2343a64a72dec3250d.tar.xz
mga-youri-submit-35d5ababc9c11a82f669ac2343a64a72dec3250d.zip
Youri action to update the Mandriva maintainers database.
-rw-r--r--lib/Youri/Submit/Action/UpdateMdvDb.pm62
1 files changed, 62 insertions, 0 deletions
diff --git a/lib/Youri/Submit/Action/UpdateMdvDb.pm b/lib/Youri/Submit/Action/UpdateMdvDb.pm
new file mode 100644
index 0000000..7906080
--- /dev/null
+++ b/lib/Youri/Submit/Action/UpdateMdvDb.pm
@@ -0,0 +1,62 @@
+# $Id$
+package Youri::Submit::Action::UpdateMdvDb;
+
+=head1 NAME
+
+Youri::Submit::Action::UpdateMdvDb - Mandriva maintainers database updater
+
+=head1 DESCRIPTION
+
+This action plugin calls an external script to update last commit info, as
+well as add new packages, in the package maintainers database at
+<http://maint.mandriva.com/>.
+
+=cut
+
+use warnings;
+use strict;
+use Carp;
+use base qw/Youri::Submit::Action/;
+
+sub _init {
+ my $self = shift;
+ my %options = (
+ @_
+ );
+
+ # path for mdvdb-updaterep script
+ $self->{_mdvdb_updaterep} = $options{mdvdb_updaterep};
+
+ return $self;
+}
+
+sub run {
+ my ($self, $package, $repository, $target, $define) = @_;
+ croak "Not a class method" unless ref $self;
+
+ # only SRPMs matter
+ return unless $package->is_source();
+
+ unless ($self->{_test}) {
+ my $pkg_name = $package->get_name();
+ my $pkg_media = $repository->_get_main_section($package, $target, $define);
+ $package->get_packager() =~ m/(\w[-_.\w]+\@[-_.\w]+)\W/;
+ my $pkg_commiter = $1;
+
+ if (system($self->{_mdvdb_updaterep}, "update", $pkg_name, $pkg_media, $pkg_commiter, "youri")) {
+ print "ERROR: ".$self->{_mdvdb_updaterep}." failed for '$pkg_name', '$pkg_media', '$pkg_commiter'.\n";
+ } else {
+ print "Updated package maintainers DB for '$pkg_name', '$pkg_media', '$pkg_commiter'.\n" if $self->{_verbose};
+ }
+ }
+}
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2007, Mandriva
+
+This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
+
+=cut
+
+1;