summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-09 21:21:18 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-09 21:21:18 +0000
commit88b37e624a74f9f0515ecded2819197a98b6bec0 (patch)
treed755593013e1254712405bc6cb447132269f1917 /urpm.pm
parent2c4a184166d2d21918b4003deb7f099c22932014 (diff)
downloadurpmi-88b37e624a74f9f0515ecded2819197a98b6bec0.tar
urpmi-88b37e624a74f9f0515ecded2819197a98b6bec0.tar.gz
urpmi-88b37e624a74f9f0515ecded2819197a98b6bec0.tar.bz2
urpmi-88b37e624a74f9f0515ecded2819197a98b6bec0.tar.xz
urpmi-88b37e624a74f9f0515ecded2819197a98b6bec0.zip
help perl_checker, simplify
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/urpm.pm b/urpm.pm
index 7600bcaf..9fc03daa 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2197,9 +2197,9 @@ sub search_packages {
&& ($options{src} ? $_->arch eq 'src' : $_->is_arch_compat)
&& ($options{use_provides} || $_->name eq $v)
&& defined($_->id)
- && (!defined $urpm->{searchmedia} || (
+ && (!defined $urpm->{searchmedia} ||
$urpm->{searchmedia}{start} <= $_->id
- && $urpm->{searchmedia}{end} >= $_->id))
+ && $urpm->{searchmedia}{end} >= $_->id)
? $_ : @{[]};
} map {
$urpm->{depslist}[$_];
@@ -2780,7 +2780,7 @@ sub copy_packages_of_removable_media {
#- 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 @sorted_media = sort { values(%{$list->[$a]}) <=> values(%{$list->[$b]}) } @{$removables{$device}};
#- check if a removable device is already mounted (and files present).
if (my ($already_mounted_medium) = grep { !$check_notfound->($_) } @sorted_media) {
@@ -2789,11 +2789,12 @@ sub copy_packages_of_removable_media {
}
#- mount all except the biggest one.
- foreach (@sorted_media[0 .. $#sorted_media-1]) {
+ my $biggest = pop @sorted_media;
+ foreach (@sorted_media) {
$examine_removable_medium->($_, $device);
}
#- now mount the last one...
- $removables{$device} = [ $sorted_media[-1] ];
+ $removables{$device} = [ $biggest ];
}
$examine_removable_medium->($removables{$device}[0], $device);