diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-09-06 14:18:36 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-09-06 14:18:36 +0000 |
commit | 5b8bece707cb4212ea1655c2ea1ed1e09a667569 (patch) | |
tree | ea0e28ee3cf35520010304d7b1b744f155eb1c07 /Rpmdrake | |
parent | c6f5a98b7a2be300c14ad648452c3ff1a5fe2073 (diff) | |
download | rpmdrake-5b8bece707cb4212ea1655c2ea1ed1e09a667569.tar rpmdrake-5b8bece707cb4212ea1655c2ea1ed1e09a667569.tar.gz rpmdrake-5b8bece707cb4212ea1655c2ea1ed1e09a667569.tar.bz2 rpmdrake-5b8bece707cb4212ea1655c2ea1ed1e09a667569.tar.xz rpmdrake-5b8bece707cb4212ea1655c2ea1ed1e09a667569.zip |
(get_pkgs,open_urpmi_db) add support for several searchmedia (needs urpmi' SVN)
Diffstat (limited to 'Rpmdrake')
-rw-r--r-- | Rpmdrake/pkg.pm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 3e07c672..8e77a5a6 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -252,9 +252,9 @@ sub open_urpmi_db() { }; my $media = ref $::rpmdrake_options{media} ? join(',', @{$::rpmdrake_options{media}}) : ''; urpm::media::configure($urpm, media => $media); - # urpmi only support one search media, hance we'll only support "Main backport": - my ($searchmedia) = grep { $_->{ignore} && $_->{name} =~ /backport/i } @{$urpm->{media}}; - urpm::media::configure($urpm, media => $media, if_($searchmedia, searchmedia => $searchmedia->{name})); + + my $searchmedia = join(',', map { $_->{name} } grep { $_->{ignore} && $_->{name} =~ /backport/i } @{$urpm->{media}}); + urpm::media::configure($urpm, media => $media, if_($searchmedia, searchmedia => $searchmedia)); if ($error_happened) { touch('/etc/urpmi/urpmi.cfg'); exec('edit-urpm-sources.pl'); @@ -394,6 +394,8 @@ sub get_pkgs { $urpm->{rpmdrake_state} = $state; #- Don't forget it Rpmdrake::gurpm::progress($level = 0.7); + my @search_medias = grep { $_->{searchmedia} } @{$urpm->{media}}; + my @backports; my %pkg_sel = map { $_ => 1 } @{$::rpmdrake_options{'pkg-sel'} || []}; my %pkg_nosel = map { $_ => 1 } @{$::rpmdrake_options{'pkg-nosel'} || []}; @@ -416,8 +418,10 @@ sub get_pkgs { push @updates, $name; } else { push @installable_pkgs, $name; - if (my $search_med = $urpm->{searchmedia}) { - push @backports, $name if $search_med->{start} <= $pkg->id && $pkg->id <= $search_med->{end}; + if (@search_medias) { + my $raw_medium = pkg2medium($pkg, $urpm); + my $medium = $raw_medium->{name}; + push @backports, $name if any { $_->{start} <= $pkg->id && $pkg->id <= $_->{end} } @search_medias; } } $all_pkgs{urpm_name($pkg)} = { selected => $selected, pkg => $pkg, |