summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-08 18:50:56 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-08 18:50:56 +0000
commit0e5a8d90c6e77256975baa394653d42172790fb3 (patch)
treecbe222116d2e0de8fb3a8d1d146879425f4dd784
parentfcb66a9dc4ce089f8f39dfb90a16486786c06623 (diff)
downloadurpmi-0e5a8d90c6e77256975baa394653d42172790fb3.tar
urpmi-0e5a8d90c6e77256975baa394653d42172790fb3.tar.gz
urpmi-0e5a8d90c6e77256975baa394653d42172790fb3.tar.bz2
urpmi-0e5a8d90c6e77256975baa394653d42172790fb3.tar.xz
urpmi-0e5a8d90c6e77256975baa394653d42172790fb3.zip
(_register_media_cfg) simplify using member()
-rw-r--r--urpm/media.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index b972883a..ee5adf27 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -906,7 +906,7 @@ sub _register_media_cfg {
if ($url) {
my $filename = $media_path . "/url";
my @urls = split(/\n/, scalar cat_($filename));
- if (!grep { $url eq $_ } @urls) {
+ if (!member($url, @urls)) {
append_to_file($filename, $url . "\n");
}
}
@@ -917,7 +917,7 @@ sub _register_media_cfg {
}
my $filename = $media_path . "/mirrorlist";
my @mirrorlists = split(/\n/, scalar cat_($filename));
- if (!grep { $mirrorlist eq $_ } @mirrorlists) {
+ if (!member($mirrorlist, @mirrorlists)) {
append_to_file($filename, $mirrorlist . "\n");
}
}