Magpie/Action/Missing.pm

filter: Statementstmt 88.2% 15 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 91.3% 21 / 23 CC 1 SCAR 0.5
CC
1
Cov
88%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Magpie/Role/Logging.pm ↑ Summary Magpie/Action/Old.pm »
1 #
2 # This file is part of App-Magpie
3 #
4 # This software is copyright (c) 2011 by Jerome Quelin.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 1 ▶use 5.012;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 package App::Magpie::Action::Missing;
14 # ABSTRACT: Missing command implementation
15 $App::Magpie::Action::Missing::VERSION = '2.010';
16 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use ORDB::CPAN::Mageia;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 0 ▶use URPM;
Subroutine BEGIN: called CC=1 SCAR=2.6
19  
20 with 'App::Magpie::Role::Logging';
21  
22  
23  
24 sub run {
25 my ($self, $opts) = @_;
26  
27 # read local rpm database
28 my $db = URPM::DB::open();
29 my @local;
30 $db->traverse( sub { my ($pkg) = @_; push @local, $pkg->name; } );
31  
32 # see perl rpms available in mageia
33 my %mageia;
34 my $mgadists = ORDB::CPAN::Mageia->selectcol_arrayref(
35 'SELECT DISTINCT pkgname FROM module ORDER BY dist'
36 );
37 @mageia{ @$mgadists } = ();
38  
39 # list available rpms not installed locally
40 delete @mageia{ @local };
41 say $_ for sort keys %mageia;
42 }
43  
44 1;
45  
46 __END__
« Magpie/Role/Logging.pm ↑ Summary Magpie/Action/Old.pm »