summaryrefslogtreecommitdiffstats
path: root/urpm/removable.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-26 20:15:19 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-26 20:15:19 +0000
commitee4232f26f1d3f850cdea580455edf48cc3a83c0 (patch)
tree5845cfcd95e9c97832c9827ed27559f101b5997c /urpm/removable.pm
parent88d14550c00cf4d2aeb54ccd56b407aa17aa4521 (diff)
downloadurpmi-ee4232f26f1d3f850cdea580455edf48cc3a83c0.tar
urpmi-ee4232f26f1d3f850cdea580455edf48cc3a83c0.tar.gz
urpmi-ee4232f26f1d3f850cdea580455edf48cc3a83c0.tar.bz2
urpmi-ee4232f26f1d3f850cdea580455edf48cc3a83c0.tar.xz
urpmi-ee4232f26f1d3f850cdea580455edf48cc3a83c0.zip
simplify
Diffstat (limited to 'urpm/removable.pm')
-rw-r--r--urpm/removable.pm20
1 files changed, 9 insertions, 11 deletions
diff --git a/urpm/removable.pm b/urpm/removable.pm
index 8acdd6c0..73663243 100644
--- a/urpm/removable.pm
+++ b/urpm/removable.pm
@@ -210,20 +210,18 @@ sub copy_packages_of_removable_media {
#- Here we have only removable devices.
#- If more than one media uses this device, we have to sort
#- needed packages to copy the needed rpm files.
- if (@{$removables{$device}} > 1) {
- my @sorted_media = sort { values(%{$list->[$a]}) <=> values(%{$list->[$b]}) } @{$removables{$device}};
+ my @l = @{$removables{$device}};
- #- check if a removable device is already mounted (and files present).
- if (my ($already_mounted_medium) = grep { !_check_notfound($urpm, $list->[$_]) } @sorted_media) {
- @sorted_media = ($already_mounted_medium,
- grep { $_ ne $already_mounted_medium } @sorted_media);
- }
+ if (@l > 1) {
+ @l = sort { values(%{$list->[$a]}) <=> values(%{$list->[$b]}) } @l;
- foreach (@sorted_media) {
- _examine_removable_medium($urpm, $list, $sources, $_, $device, $o_ask_for_medium);
+ #- check if a removable device is already mounted (and files present).
+ if (my ($already_mounted) = grep { !_check_notfound($urpm, $list->[$_]) } @l) {
+ @l = ($already_mounted, grep { $_ ne $already_mounted_medium } @l);
}
- } else {
- _examine_removable_medium($urpm, $list, $sources, $removables{$device}[0], $device, $o_ask_for_medium);
+ }
+ foreach (@l) {
+ _examine_removable_medium($urpm, $list, $sources, $_, $device, $o_ask_for_medium);
}
}