summaryrefslogtreecommitdiffstats
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
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)
-rw-r--r--urpm/media.pm10
-rw-r--r--urpm/select.pm12
2 files changed, 12 insertions, 10 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index cfc3ab8a..265ff667 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -592,13 +592,9 @@ sub _parse_media {
unless ($_->{ignore}) {
_check_after_reading_hdlist_or_synthesis($urpm, $_);
}
- unless ($_->{ignore}) {
- if ($_->{searchmedia}) {
- ($urpm->{searchmedia}{start}, $urpm->{searchmedia}{end}) = ($_->{start}, $_->{end});
- $urpm->{log}(N("Search start: %s end: %s",
- $urpm->{searchmedia}{start}, $urpm->{searchmedia}{end}));
- delete $_->{searchmedia};
- }
+ if ($_->{searchmedia}) {
+ $urpm->{searchmedia} = 1;
+ $urpm->{log}(N("Search start: %s end: %s", $_->{start}, $_->{end}));
}
}
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) = @_;