aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/pkg.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-08-24 16:53:05 +0000
committerThierry Vignaud <tv@mandriva.org>2007-08-24 16:53:05 +0000
commit5ef73364e0b9da03f38adbc9559de40e3ea3605b (patch)
treeed721ccaf132c71dc711337973e0aded23c2d3e8 /Rpmdrake/pkg.pm
parent69af4368dbc69f579d0221b2d45135079ed42f61 (diff)
downloadrpmdrake-5ef73364e0b9da03f38adbc9559de40e3ea3605b.tar
rpmdrake-5ef73364e0b9da03f38adbc9559de40e3ea3605b.tar.gz
rpmdrake-5ef73364e0b9da03f38adbc9559de40e3ea3605b.tar.bz2
rpmdrake-5ef73364e0b9da03f38adbc9559de40e3ea3605b.tar.xz
rpmdrake-5ef73364e0b9da03f38adbc9559de40e3ea3605b.zip
first attempt to provide a "Backports" view (it only looks at first disabled backport medium)
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rwxr-xr-xRpmdrake/pkg.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index bd8abe0f..eed64ba0 100755
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -244,6 +244,9 @@ sub open_urpmi_db() {
};
my $media = ref $::options{media} ? join(',', @{$::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}})[0]->{name};
+ urpm::media::configure($urpm, media => $media, searchmedia => $searchmedia);
if ($error_happened) {
touch('/etc/urpmi/urpmi.cfg');
exec('edit-urpm-sources.pl');
@@ -383,6 +386,7 @@ sub get_pkgs {
$urpm->{rpmdrake_state} = $state; #- Don't forget it
Rpmdrake::gurpm::progress($level = 0.7);
+ my @backports;
my %pkg_sel = map { $_ => 1 } @{$::options{'pkg-sel'} || []};
my %pkg_nosel = map { $_ => 1 } @{$::options{'pkg-nosel'} || []};
$reset_update->(1);
@@ -405,6 +409,9 @@ 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};
+ }
}
$all_pkgs{urpm_name($pkg)} = { selected => $selected, pkg => $pkg };
}
@@ -425,6 +432,7 @@ sub get_pkgs {
installable => \@installable_pkgs,
updates => \@updates,
update_descr => \%update_descr,
+ backports => \@backports,
};
}