diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-09 21:21:18 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-09 21:21:18 +0000 |
commit | 88b37e624a74f9f0515ecded2819197a98b6bec0 (patch) | |
tree | d755593013e1254712405bc6cb447132269f1917 /urpm.pm | |
parent | 2c4a184166d2d21918b4003deb7f099c22932014 (diff) | |
download | urpmi-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.pm | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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); |