summaryrefslogtreecommitdiffstats
path: root/urpm/select.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-06 14:04:40 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-06 14:04:40 +0000
commitc3013e208935bac1b1f546f36c2beb0e51714817 (patch)
tree80772850d55ff8bee309f8795bf924be7766e4d7 /urpm/select.pm
parent6f23b47db6f4a4e69267eb4fd5b70f21fd1fa6d0 (diff)
downloadurpmi-c3013e208935bac1b1f546f36c2beb0e51714817.tar
urpmi-c3013e208935bac1b1f546f36c2beb0e51714817.tar.gz
urpmi-c3013e208935bac1b1f546f36c2beb0e51714817.tar.bz2
urpmi-c3013e208935bac1b1f546f36c2beb0e51714817.tar.xz
urpmi-c3013e208935bac1b1f546f36c2beb0e51714817.zip
handle --searchmedia <media1>,...,<mediaN>
(ie more than one searchmedia)
Diffstat (limited to 'urpm/select.pm')
-rw-r--r--urpm/select.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/urpm/select.pm b/urpm/select.pm
index 645105fa..ddf04ea6 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -47,12 +47,18 @@ sub _findindeps {
sub pkg_in_searchmedia {
my ($urpm, $pkg) = @_;
- $urpm->{searchmedia}{start} <= $pkg->id
- && $urpm->{searchmedia}{end} >= $pkg->id;
+ foreach my $medium (grep { $_->{searchmedia} } @{$urpm->{media}}) {
+ $medium->{start} <= $pkg->id
+ && $medium->{end} >= $pkg->id and return 1;
+ }
+ 0;
}
sub searchmedia_idlist {
my ($urpm) = @_;
- $urpm->{searchmedia} && [ $urpm->{searchmedia}{start} .. $urpm->{searchmedia}{end} ];
+ $urpm->{searchmedia} && [
+ map { $_->{start} .. $_->{end} }
+ grep { $_->{searchmedia} } @{$urpm->{media}}
+ ];
}
sub build_listid_ {
my ($urpm) = @_;