aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
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
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')
-rw-r--r--Rpmdrake/gui.pm1
-rwxr-xr-xRpmdrake/pkg.pm8
2 files changed, 9 insertions, 0 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index 56014e14..ea8177f3 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -408,6 +408,7 @@ sub pkgs_provider {
my @pkgs = $options{pure_updates} ? () : (grep { my $p = $pkgs->{$_}; $p->{pkg} && !$p->{selected} && $p->{pkg}->flag_installed && $p->{pkg}->flag_upgrade } @{$h->{installable}});
@filtered_pkgs = @{$h->{updates}}, @pkgs;
},
+ backports => sub { @filtered_pkgs = @{$h->{backports}} },
);
foreach my $importance (qw(bugfix security normal)) {
$filter_methods{$importance} = sub {
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,
};
}