X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo.pm;h=c86573c0e17f3053f009551419643bfce310e19f;hp=3c6d883ae76652ab8d84b346133b1f4008279300;hb=df1df6f85cf0d3f58fdeccc27e2fcfccc3083ec3;hpb=429baac5b02f5d63589a910076a2aa06b13c3788 diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 3c6d883..c86573c 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -4,7 +4,7 @@ use strict; use warnings; use Cwd (); -use List::Util qw/reduce/; +use List::Util qw; use File::Copy (); use File::Path (); use File::Spec; @@ -14,7 +14,7 @@ use Parse::CPAN::Meta (); use CPANPLUS::Error (); -use base qw/CPANPLUS::Dist::Base/; +use base qw; use CPANPLUS::Dist::Gentoo::Atom; use CPANPLUS::Dist::Gentoo::Guard; @@ -72,8 +72,7 @@ Bootstrap an ebuild for L using itself. First, make sure your system C is C<5.10> or greater, so that the L toolchain is available. $ perl -v - This is perl 5, version 12, subversion 2 (v5.12.2) built for x86_64-linux - ... + This is perl 5, version 12, subversion 2 (v5.12.2)... C C<5.12> is the current stable Perl version in Gentoo. If you still have C C<5.8.x>, you can upgrade it by running the following commands as root : @@ -94,6 +93,8 @@ Log in as root and unpack it in e.g. your home directory : Bootstrap L using the bundled shell script C : + # perl Makefile.PL + # make # PERL5LIB=blib/lib samples/g-cpanp CPANPLUS::Dist::Gentoo Finally, emerge the C ebuild you've just generated : @@ -131,7 +132,7 @@ my $format_available; sub format_available { return $format_available if defined $format_available; - for my $prog (qw/emerge ebuild/) { + for my $prog (qw) { unless (IPC::Cmd::can_run($prog)) { __PACKAGE__->_abort("$prog is required to write ebuilds"); return $format_available = 0; @@ -141,7 +142,7 @@ sub format_available { if (IPC::Cmd->can_capture_buffer) { my $buffers; my ($success, $errmsg) = IPC::Cmd::run( - command => [ qw/emerge --info/ ], + command => [ qw ], verbose => 0, buffer => \$buffers, ); @@ -160,6 +161,7 @@ sub format_available { } } else { __PACKAGE__->_abort($errmsg); + return $format_available = 0; } } @@ -174,14 +176,15 @@ sub init { my $stat = $self->status; my $conf = $self->parent->parent->configure_object; - $stat->mk_accessors(qw/name version author distribution desc uri src license - meta min_perl - fetched_arch - requires configure_requires recursive_requires - ebuild_name ebuild_version ebuild_dir ebuild_file - portdir_overlay - overlay distdir keywords do_manifest header footer - force verbose/); + $stat->mk_accessors(qw< + name version author distribution desc uri src license + meta min_perl + fetched_arch + requires configure_requires recursive_requires + ebuild_name ebuild_version ebuild_dir ebuild_file + portdir_overlay overlay distdir keywords do_manifest header footer + force verbose + >); $stat->force($conf->get_conf('force')); $stat->verbose($conf->get_conf('verbose')); @@ -378,7 +381,7 @@ sub meta { my $extract_dir = $mod->status->extract; - for my $name (qw/META.json META.yml/) { + for my $name (qw) { my $meta_file = File::Spec->catdir($extract_dir, $name); next unless -e $meta_file; @@ -645,7 +648,7 @@ sub _cpan2portage { my @portdirs = ($main_portdir, @{$self->status->portdir_overlay}); - for my $category (qw/virtual perl-core dev-perl perl-gcpan/, CATEGORY) { + for my $category (qw, CATEGORY) { my $name = ($category eq 'virtual' ? 'perl-' : '') . $name; for my $portdir (@portdirs) {