aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Youri/Check/Input/Orphans.pm
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-01-06 01:07:55 +0000
committerNicolas Vigier <boklm@mageia.org>2011-01-06 01:07:55 +0000
commita4f149873af1e9cff9ab0829adfcd3eca1a3780d (patch)
treec1345b951f4c67e3e9c5bf57f984c3e9f901f17f /lib/Youri/Check/Input/Orphans.pm
downloadmga-youri-core-a4f149873af1e9cff9ab0829adfcd3eca1a3780d.tar
mga-youri-core-a4f149873af1e9cff9ab0829adfcd3eca1a3780d.tar.gz
mga-youri-core-a4f149873af1e9cff9ab0829adfcd3eca1a3780d.tar.bz2
mga-youri-core-a4f149873af1e9cff9ab0829adfcd3eca1a3780d.tar.xz
mga-youri-core-a4f149873af1e9cff9ab0829adfcd3eca1a3780d.zip
search in core, nonfree, tainted instead of main, contrib
Diffstat (limited to 'lib/Youri/Check/Input/Orphans.pm')
-rw-r--r--lib/Youri/Check/Input/Orphans.pm74
1 files changed, 74 insertions, 0 deletions
diff --git a/lib/Youri/Check/Input/Orphans.pm b/lib/Youri/Check/Input/Orphans.pm
new file mode 100644
index 0000000..e193f0e
--- /dev/null
+++ b/lib/Youri/Check/Input/Orphans.pm
@@ -0,0 +1,74 @@
+package Youri::Check::Input::Orphans;
+
+=head1 NAME
+
+Youri::Check::Input::Orphans - Check maintainance
+
+=head1 DESCRIPTION
+
+This plugin checks maintainance status of packages, and reports unmaintained
+ones.
+
+=cut
+
+use warnings;
+use strict;
+use Carp;
+use base 'Youri::Check::Input';
+
+sub columns {
+ return qw/
+ error
+ /;
+}
+
+sub links {
+ return qw//;
+}
+
+=head2 new(%args)
+
+Creates and returns a new Youri::Check::Input::Orphans object.
+
+No specific parameters.
+
+=cut
+
+sub _init {
+ my $self = shift;
+ my %options = (
+ resolver => undef,
+ @_
+ );
+
+ croak "No resolver defined" unless $options{resolver};
+
+ $self->{_resolver} = $options{resolver};
+}
+
+sub run {
+ my ($self, $media, $resultset) = @_;
+ croak "Not a class method" unless ref $self;
+
+ # this is a source media check only
+ return unless $media->get_type() eq 'source';
+
+ my $check = sub {
+ my ($package) = @_;
+ $resultset->add_result($self->{_id}, $media, $package, {
+ error => "unmaintained package"
+ }) unless $self->{_resolver}->get_maintainer($package);
+ };
+
+ $media->traverse_headers($check);
+}
+
+=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;