From: Vincent Pit Date: Sun, 16 Aug 2009 22:06:34 +0000 (+0200) Subject: Style nits X-Git-Tag: v0.08~8 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=cbde8f35036b3f991eecdb99abba188039914751;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git Style nits --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 9cc1250..a616e7e 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -147,7 +147,7 @@ sub prepare { my $OK = sub { $stat->prepared(1); 1 }; my $FAIL = sub { $stat->prepared(0); $self->_abort(@_) if @_; 0 }; - my $keywords = delete $opts{'keywords'}; + my $keywords = delete $opts{keywords}; if (defined $keywords) { $keywords = [ split ' ', $keywords ]; } else { @@ -155,12 +155,12 @@ sub prepare { } $stat->keywords($keywords); - my $manifest = delete $opts{'manifest'}; + my $manifest = delete $opts{manifest}; $manifest = 1 unless defined $manifest; $manifest = 0 if $manifest =~ /^\s*no?\s*$/i; $stat->do_manifest($manifest); - my $header = delete $opts{'header'}; + my $header = delete $opts{header}; if (defined $header) { 1 while chomp $header; $header .= "\n\n"; @@ -169,7 +169,7 @@ sub prepare { } $stat->header($header); - my $footer = delete $opts{'footer'}; + my $footer = delete $opts{footer}; if (defined $footer) { $footer = "\n" . $footer; } else { @@ -177,17 +177,16 @@ sub prepare { } $stat->footer($footer); - my $overlay = delete $opts{'overlay'}; + my $overlay = delete $opts{overlay}; $overlay = (defined $overlay) ? abs_path $overlay : '/usr/local/portage'; $stat->overlay($overlay); - my $distdir = delete $opts{'distdir'}; + my $distdir = delete $opts{distdir}; $distdir = (defined $distdir) ? abs_path $distdir : $default_distdir; $stat->distdir($distdir); - if ($stat->do_manifest && !-w $stat->distdir) { - return $FAIL->('distdir isn\'t writable'); - } + return $FAIL->("distdir isn't writable") if $stat->do_manifest && !-w $distdir; + $stat->fetched_arch($mod->status->fetch); my $cur = File::Spec->curdir(); @@ -261,11 +260,8 @@ sub prepare { $stat->uri('http://search.cpan.org/dist/' . $name); - unless ($author =~ /^(.)(.)/) { - return $FAIL->('Wrong author name'); - } - $stat->src("mirror://cpan/modules/by-authors/id/$1/$1$2/$author/" - . $mod->package); + $author =~ /^(.)(.)/ or return $FAIL->('Wrong author name'); + $stat->src("mirror://cpan/modules/by-authors/id/$1/$1$2/$author/" . $mod->package); $stat->license($self->intuit_license); @@ -317,6 +313,7 @@ sub intuit_license { my @licenses = CPANPLUS::Dist::Gentoo::Maps::license_c2g($dslip_license{$1}); return \@licenses if @licenses; } + my $extract_dir = $mod->status->extract; for my $meta_file (qw/META.json META.yml/) {