From: Vincent Pit Date: Thu, 16 Dec 2010 00:03:31 +0000 (+0100) Subject: Switch to <> for qw delimiters X-Git-Tag: v0.11~6 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=commitdiff_plain;h=d77142c8216a27e216565391d32d2cf3f321f63c Switch to <> for qw delimiters --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 3c6d883..474dce6 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; @@ -131,7 +131,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 +141,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, ); @@ -174,14 +174,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 +379,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 +646,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) { diff --git a/lib/CPANPLUS/Dist/Gentoo/Atom.pm b/lib/CPANPLUS/Dist/Gentoo/Atom.pm index 59f1d6a..543ece4 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Atom.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Atom.pm @@ -53,7 +53,7 @@ sub new { my ($range, $category, $name, $version); if (defined $args{name}) { - ($range, $category, $name, $version) = @args{qw/range category name version/}; + ($range, $category, $name, $version) = @args{qw}; Carp::confess('Category unspecified') unless defined $category; Carp::confess('Invalid category') unless $category =~ /^$category_rx$/o; Carp::confess('Invalid name') unless $name =~ /^$name_rx$/o; @@ -119,7 +119,7 @@ sub new_from_ebuild { } BEGIN { - eval "sub $_ { \$_[0]->{$_} }" for qw/category name version range ebuild/; + eval "sub $_ { \$_[0]->{$_} }" for qw; } =head2 C diff --git a/lib/CPANPLUS/Dist/Gentoo/Maps.pm b/lib/CPANPLUS/Dist/Gentoo/Maps.pm index 9c91f85..f9c478c 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Maps.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Maps.pm @@ -173,11 +173,11 @@ my $letters_as_suffix = sub { my %version_mismatch; -$version_mismatch{$_} = $insert_dot_at_1 for qw/ +$version_mismatch{$_} = $insert_dot_at_1 for qw< CGI-Simple -/; +>; -$version_mismatch{$_} = $insert_dot_at_all_1 for qw/ +$version_mismatch{$_} = $insert_dot_at_all_1 for qw< AnyEvent Archive-Rar IO-AIO @@ -187,13 +187,13 @@ $version_mismatch{$_} = $insert_dot_at_all_1 for qw/ Tie-Array-Sorted Tk-TableMatrix XML-RSS-Feed -/; +>; -$version_mismatch{$_} = $insert_dot_at_2 for qw/ +$version_mismatch{$_} = $insert_dot_at_2 for qw< Error -/; +>; -$version_mismatch{$_} = $insert_dot_at_all_2 for qw/ +$version_mismatch{$_} = $insert_dot_at_all_2 for qw< Authen-Htpasswd BSD-Resource CDDB @@ -216,35 +216,35 @@ $version_mismatch{$_} = $insert_dot_at_all_2 for qw/ Time-HiRes Time-Local perl-ldap -/; +>; -$version_mismatch{$_} = $insert_dot_at_all_3 for qw/ +$version_mismatch{$_} = $insert_dot_at_all_3 for qw< Parse-RecDescent Return-Value -/; +>; -$version_mismatch{$_} = $pad_decimals_to_2 for qw/ +$version_mismatch{$_} = $pad_decimals_to_2 for qw< Nmap-Parser XML-AutoWriter -/; +>; -$version_mismatch{$_} = $pad_decimals_to_4 for qw/ +$version_mismatch{$_} = $pad_decimals_to_4 for qw< Convert-BER -/; +>; -$version_mismatch{$_} = $correct_suffixes for qw/ +$version_mismatch{$_} = $correct_suffixes for qw< Gimp XML-Grove -/; +>; -$version_mismatch{$_} = $strip_letters for qw/ +$version_mismatch{$_} = $strip_letters for qw< DelimMatch SGMLSpm -/; +>; -$version_mismatch{$_} = $letters_as_suffix for qw/ +$version_mismatch{$_} = $letters_as_suffix for qw< Frontier-RPC -/; +>; sub version_c2g { my ($n, $v) = @_; diff --git a/lib/CPANPLUS/Dist/Gentoo/Version.pm b/lib/CPANPLUS/Dist/Gentoo/Version.pm index bce74ea..752fe97 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Version.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Version.pm @@ -33,7 +33,7 @@ my $positive_int_rx = qr/0*[1-9][0-9]*/; my $letter_rx = qr/[a-zA-Z]/; my $dotted_num_rx = qr/$int_rx(?:\.$int_rx)*/o; -my @suffixes = qw(alpha beta pre rc normal p); +my @suffixes = qw; my $suffix_rx = join '|', grep !/^normal$/, @suffixes; $suffix_rx = qr/(?:$suffix_rx)/o; @@ -86,7 +86,7 @@ sub new { my @parts; BEGIN { - @parts = qw/version letter suffixes revision/; + @parts = qw; eval "sub $_ { \$_[0]->{$_} }" for @parts; } diff --git a/samples/gengentooisms b/samples/gengentooisms index 34d5869..fcd656a 100755 --- a/samples/gengentooisms +++ b/samples/gengentooisms @@ -5,14 +5,14 @@ use warnings; use Fatal; use File::Spec; -use File::Copy qw/copy/; -use List::Util qw/max reduce/; +use File::Copy qw; +use List::Util qw; use Storable (); use Term::ANSIColor; use CPAN::DistnameInfo 0.11; -use Capture::Tiny qw/capture/; +use Capture::Tiny qw; use LWP::UserAgent; use Parse::CPAN::Packages::Fast; @@ -74,7 +74,7 @@ my (@not_on_cpan, @unfindable, @missing, %name_mismatch, %version); sub parse_portage_tree { my $pcp = Parse::CPAN::Packages::Fast->new(PACKAGES); - for my $category (qw/perl-core dev-perl/) { + for my $category (qw) { p(0, "Browsing the $category category.\n"); my $cat_dir = File::Spec->catdir(PORTAGE, $category); @@ -88,7 +88,7 @@ sub parse_portage_tree { map [ $_, CPANPLUS::Dist::Gentoo::Atom->new_from_ebuild($_) ], glob File::Spec->catfile($pkg_dir, "$pkg_name-*"); my ($ebuild, $atom) = @$last; - p(1, "%s/%s-%s\n", map $atom->$_, qw/category name version/); + p(1, "%s/%s-%s\n", map $atom->$_, qw); if (exists $is_on_cpan{$pkg_name} and not $is_on_cpan{$pkg_name}) { p(2, colored("$pkg_name is not a CPAN distribution (forced)", 'bright_red') diff --git a/t/12-maps-version.t b/t/12-maps-version.t index da28c32..823e98c 100644 --- a/t/12-maps-version.t +++ b/t/12-maps-version.t @@ -25,13 +25,13 @@ is vc2g('1_.1_2'), '1_p12', "version_c2g('1_.1_2')"; is vc2g('1_.1_.2'), '1_p12', "version_c2g('1_.1_.2')"; for my $test ([ '0.12' => '0.12' ], [ '0.1234' => '0.12.34' ]) { - my @dists = qw/ + my @dists = qw< ExtUtils-CBuilder ExtUtils-ParseXS Module-Build Time-HiRes Time-Local - /; + >; for my $dist (@dists) { is vc2g($dist, $test->[0]), $test->[1], "'version_c2g('$dist', '$test->[0]')"; } diff --git a/t/13-maps-license.t b/t/13-maps-license.t index e3119dc..a63afa7 100644 --- a/t/13-maps-license.t +++ b/t/13-maps-license.t @@ -15,6 +15,6 @@ sub check_licenses { check_licenses [ ], [ ], 'empty'; check_licenses [ undef ], [ ], 'undef'; check_licenses [ 'woo' ], [ ], 'nonexistent'; -check_licenses [ 'perl' ], [ qw/Artistic GPL-2/ ], 'perl'; -check_licenses [ qw/perl gpl2/ ], [ qw/Artistic GPL-2/ ], 'perl + gpl2'; -check_licenses [ qw/perl bsd/ ], [ qw/Artistic GPL-2 BSD/ ], 'perl + bsd'; +check_licenses [ 'perl' ], [ qw ], 'perl'; +check_licenses [ qw ], [ qw ], 'perl + gpl2'; +check_licenses [ qw ], [ qw ], 'perl + bsd'; diff --git a/t/30-atom-new.t b/t/30-atom-new.t index c51175e..0a14f6f 100644 --- a/t/30-atom-new.t +++ b/t/30-atom-new.t @@ -56,7 +56,7 @@ my @tests = ( [ { ebuild => '/wat/test+/a+b/a+b-1.2.3.ebuild' } => { %$a2, range => '>=' } ], ); -my @fields = qw/range category name version ebuild/; +my @fields = qw; for my $t (@tests) { my ($args, $exp) = @$t; diff --git a/t/92-pod-coverage.t b/t/92-pod-coverage.t index 27e0cf8..3a705ed 100644 --- a/t/92-pod-coverage.t +++ b/t/92-pod-coverage.t @@ -13,4 +13,6 @@ my $min_pc = 0.18; eval "use Pod::Coverage $min_pc"; plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" if $@; -all_pod_coverage_ok( { also_private => [ qw/format_available init prepare create install uninstall/ ] }); +all_pod_coverage_ok({ + also_private => [ qw ], +});