| 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__ | ||