aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Rpmdrake/gui.pm1
-rwxr-xr-xRpmdrake/pkg.pm8
-rwxr-xr-xrpmdrake4
3 files changed, 11 insertions, 2 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,
};
}
diff --git a/rpmdrake b/rpmdrake
index ce2c34de..b0aaf19d 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -248,7 +248,7 @@ sub run_treeview_dialog {
by_leaves => N("Leaves only, sorted by install date"),
by_group => N("All packages, by group"),
),
- if_(0, N("Backports")),
+ backports => N("Backports"),
all_updates => N("All updates"),
security => N("Security updates"),
bugfix => N("Bugfixes updates"),
@@ -269,7 +269,7 @@ sub run_treeview_dialog {
);
my $old_value;
my $cbox = gtksignal_connect(Gtk2::ComboBox->new_with_strings([ @modes{'all', if_($compssUsers, 'mandrake_choices'),
- qw(installed non_installed all_updates security bugfix normal)
+ qw(installed non_installed all_updates security bugfix normal backports)
} ],
$modes{$default_mode{$MODE} || 'all'}),
changed => sub {