diff options
author | Brian Fraser <fraserbn@gmail.com> | 2013-03-23 17:42:34 -0300 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-03-26 21:06:51 -0600 |
commit | 44ac36ff996782b807ffe693b62e66e436f5a91f (patch) | |
tree | 1b73229fd61e3f69814548ffe231caae916f886b /Porting/core-cpan-diff | |
parent | df711a6015fca36881af2e0c4c5fc3eb58221863 (diff) | |
download | perl-44ac36ff996782b807ffe693b62e66e436f5a91f.tar.gz |
Porting/core-cpan-diff: Drop dependency on smartmatch
Diffstat (limited to 'Porting/core-cpan-diff')
-rw-r--r-- | Porting/core-cpan-diff | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Porting/core-cpan-diff b/Porting/core-cpan-diff index 8483e1843d..60a27d18c9 100644 --- a/Porting/core-cpan-diff +++ b/Porting/core-cpan-diff @@ -226,6 +226,7 @@ sub do_compare { } my %ignorable = map { ( $_ => 1 ) } @Maintainers::IGNORABLE; + my %wanted_upstream = map { ( $_ => 1 ) } @$wanted_upstreams; my %seen_dist; for my $module (@$modules) { @@ -247,7 +248,7 @@ sub do_compare { } my $upstream = $m->{UPSTREAM}; - next if @$wanted_upstreams and !( $upstream ~~ $wanted_upstreams ); + next if @$wanted_upstreams and !$wanted_upstream{$upstream}; print $outfh "\n$module - " . $Maintainers::Modules{$module}->{DISTRIBUTION} . "\n"; @@ -477,6 +478,7 @@ sub do_crosscheck { $distros{ distro_base($short_distro) }{$distro} = 1; } + my %wanted_upstream = map { ( $_ => 1 ) } @$wanted_upstreams; for my $module (@$modules) { my $m = $Maintainers::Modules{$module} or die "ERROR: No such module in Maintainers.pl: '$module'\n"; @@ -495,7 +497,7 @@ sub do_crosscheck { die "ERROR: $module has no DISTRIBUTION entry\n" unless defined $pdist; my $upstream = $m->{UPSTREAM}; - next if @$wanted_upstreams and !( $upstream ~~ $wanted_upstreams ); + next if @$wanted_upstreams and !$wanted_upstream{$upstream}; my $cdist = $modules{$module}; ( my $short_pdist = $pdist ) =~ s{^.*/}{}; @@ -578,8 +580,9 @@ sub get_map { sub cpan_to_perl { my ( $excluded, $map, $customized, $cpan_file ) = @_; + my %customized = map { ( $_ => 1 ) } @$customized; for my $exclude (@$excluded) { - next if $exclude ~~ $customized; + next if $customized{$exclude}; # may be a simple string to match exactly, or a pattern if ( ref $exclude ) { |