summaryrefslogtreecommitdiffstats
path: root/urpmi.update
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-08-21 09:34:02 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-08-21 09:34:02 +0000
commit323638bab20b8fd0f8e18bb879b4792a2dcbaf9d (patch)
tree535adc801373d0a34331024ea64c64bc61f1f03c /urpmi.update
parenta49b375e0fab763b496f00bb4195b91a5326edfd (diff)
downloadurpmi-323638bab20b8fd0f8e18bb879b4792a2dcbaf9d.tar
urpmi-323638bab20b8fd0f8e18bb879b4792a2dcbaf9d.tar.gz
urpmi-323638bab20b8fd0f8e18bb879b4792a2dcbaf9d.tar.bz2
urpmi-323638bab20b8fd0f8e18bb879b4792a2dcbaf9d.tar.xz
urpmi-323638bab20b8fd0f8e18bb879b4792a2dcbaf9d.zip
cleanup
Diffstat (limited to 'urpmi.update')
-rwxr-xr-xurpmi.update18
1 files changed, 9 insertions, 9 deletions
diff --git a/urpmi.update b/urpmi.update
index a1c57e44..5ae0c31c 100755
--- a/urpmi.update
+++ b/urpmi.update
@@ -71,32 +71,32 @@ if ($< != 0) {
my $_urpmi_lock = urpm::lock::urpmi_db($urpm, 'exclusive', wait => $options{wait_lock});
urpm::media::read_config($urpm);
-my @entries = map { $_->{name} } @{$urpm->{media}};
+my @chosen_media;
if ($options{all} && !defined $options{ignore}) {
- @entries == 0 and die N("nothing to update (use urpmi.addmedia to add a media)\n");
+ @chosen_media = @{$urpm->{media}}
+ or die N("nothing to update (use urpmi.addmedia to add a media)\n");
} else {
if ($options{all}) { @cmdline = '' } #- select all
urpm::media::select_media($urpm, @cmdline);
- my $something_todo = 0;
foreach (@{$urpm->{media}}) {
$options{update} && $_->{update} and $_->{modified} = 1;
- if ($_->{modified}) {
+ }
+ @chosen_media = grep { $_->{modified} } @{$urpm->{media}}
+ or die N("the entry to update is missing\n(one of %s)\n", join(", ", map { $_->{name} } @{$urpm->{media}}));
+
+ foreach (@chosen_media) {
if ($options{ignore}) {
$_->{ignore} = 1;
} else {
#- force ignored media to be returned alive.
delete $_->{ignore};
}
- ++$something_todo;
- }
}
-
- $something_todo or die N("the entry to update is missing\n(one of %s)\n", join(", ", @entries));
}
if (defined $options{ignore}) {
- my $str = join(", ", map { N("\"%s\"", $_->{name}) } grep { $_->{modified} } @{$urpm->{media}});
+ my $str = join(", ", map { N("\"%s\"", $_->{name}) } @chosen_media);
$urpm->{log}($options{ignore} ? N("ignoring media %s", $str) : N("enabling media %s", $str));
urpm::media::write_config($urpm);
} else {