summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-08 18:51:03 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-08 18:51:03 +0000
commite156b1ce366fb2c05298731a3ba4ceb905e88738 (patch)
tree27605629ea67de4bd93b676f7a247ab72c9aa9f4
parentb7e56b30b8c4801b1d4d4a47c71d92de0e7bc438 (diff)
downloadurpmi-e156b1ce366fb2c05298731a3ba4ceb905e88738.tar
urpmi-e156b1ce366fb2c05298731a3ba4ceb905e88738.tar.gz
urpmi-e156b1ce366fb2c05298731a3ba4ceb905e88738.tar.bz2
urpmi-e156b1ce366fb2c05298731a3ba4ceb905e88738.tar.xz
urpmi-e156b1ce366fb2c05298731a3ba4ceb905e88738.zip
use newly introduced any()
-rw-r--r--urpm/cfg.pm2
-rw-r--r--urpm/media.pm6
-rw-r--r--urpm/signature.pm2
3 files changed, 5 insertions, 5 deletions
diff --git a/urpm/cfg.pm b/urpm/cfg.pm
index 5e002b0d..2bd90633 100644
--- a/urpm/cfg.pm
+++ b/urpm/cfg.pm
@@ -136,7 +136,7 @@ sub load_config_raw {
} elsif (/^(.*?[^\\])\s+(?:(.*?[^\\])\s+)?{$/) {
#- medium definition
my ($name, $url) = (unquotespace($1), unquotespace($2));
- if (grep { $_->{name} eq $name } @blocks) {
+ if (any { $_->{name} eq $name } @blocks) {
#- hmm, somebody fudged urpmi.cfg by hand.
$err = N("medium `%s' is defined twice, aborting", $name);
return;
diff --git a/urpm/media.pm b/urpm/media.pm
index ee5adf27..fc3d77c6 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1141,18 +1141,18 @@ sub _cleanup_mediacfg_dir {
$medium->{mediacfg}[0]{root} or next;
my $dir = reduce_pathname(dirname($medium->{mediacfg}[0]{root}));
begins_with($medium->{mediacfg}[0]{root}, $dir) or next;
- if (!grep { $_->{mediacfg}[0]{root} == $medium->{mediacfg}[0]{root} } @{$urpm->{media}}) {
+ if (!any { $_->{mediacfg}[0]{root} == $medium->{mediacfg}[0]{root} } @{$urpm->{media}}) {
$urpm->{debug} and $urpm->{debug}("removing no longer used $dir");
-d $dir and urpm::sys::clean_dir($dir);
next;
}
if ($medium->{mirrorlist}) {
- if (!grep { $_->{mirrorlist} eq $medium->{mirrorlist} } @{$urpm->{media}}) {
+ if (!any { $_->{mirrorlist} eq $medium->{mirrorlist} } @{$urpm->{media}}) {
_remove_medium_from_mediacfg($urpm, $dir, $medium->{mirrorlist}, 1);
}
} elsif ($medium->{url}) {
- if (!grep { $_->{url} eq $medium->{url} } @{$urpm->{media}}) {
+ if (!any { $_->{url} eq $medium->{url} } @{$urpm->{media}}) {
_remove_medium_from_mediacfg($urpm, $dir, $medium->{url}, 0);
}
}
diff --git a/urpm/signature.pm b/urpm/signature.pm
index 6272dfac..235867bf 100644
--- a/urpm/signature.pm
+++ b/urpm/signature.pm
@@ -53,7 +53,7 @@ sub _check {
my $invalid_ids = 0;
foreach my $key_id ($verif =~ /(?:key id \w{8}|#)(\w+)/gi) {
- if (grep { hex($_) == hex($key_id) } split /[,\s]+/, $key_ids) {
+ if (any { hex($_) == hex($key_id) } split /[,\s]+/, $key_ids) {
++$valid_ids;
} else {
++$invalid_ids;