From d0021121b78511e15d568206b421e97a5ff46c63 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sun, 15 Feb 2009 08:22:14 +0000 Subject: (get_pkgs) add 'compute_updates' option that enable super fast startup by skipping computing updates on startup --- NEWS | 4 ++++ Rpmdrake/pkg.pm | 10 ++++++++-- rpmdrake | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 4501eb91..83f32079 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +- rpmdrake: + o add 'compute_updates' option that enable super fast startup by + skipping computing updates on startup + Version 5.8 - 15 February 2009, Thierry Vignaud - fix crashing on uninstalling packages (#47751) diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 8d0c34b4..c1d395e5 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -432,6 +432,10 @@ sub get_pkgs { priority_upgrade => $urpm->{options}{'priority-upgrade'}, ); + my (@requested, @requested_strict); + + + if ($::rpmdrake_options{compute_updates}) { if ($urpm->{options}{'priority-upgrade'}) { $need_restart = urpm::select::resolve_priority_upgrades_after_auto_select($urpm, $db, $state, @@ -439,10 +443,10 @@ sub get_pkgs { } # list of updates (including those matching /etc/urpmi/skip.list): - my @requested = sort map { urpm_name($_) } @{$urpm->{depslist}}[keys %$requested]; + @requested = sort map { urpm_name($_) } @{$urpm->{depslist}}[keys %$requested]; # list of pure updates (w/o those matching /etc/urpmi/skip.list but with their deps): - my @requested_strict; + @requested_strict; if ($probe_only_for_updates && !$need_restart) { @requested_strict = sort map { urpm_name($_); @@ -471,6 +475,8 @@ sub get_pkgs { # do not pre select updates in rpmdrake: undef @requested_strict if !$probe_only_for_updates; + } + $priority_state = $need_restart ? $state : undef; $priority_requested = $need_restart ? $requested : undef; diff --git a/rpmdrake b/rpmdrake index e5937c64..6407f7a3 100755 --- a/rpmdrake +++ b/rpmdrake @@ -519,6 +519,7 @@ sub run_treeview_dialog { my %check_boxes; my $auto_string = N("/_Options") . N("/_Select dependencies without asking"); my $noclean_string = N("/_Options") . "/" . N("Clear download cache after successfull install"); + my $updates_string = N("/_Options") . N("/_Compute updates on startup"); my ($menu, $factory) = create_factory_menu( $w->{real_window}, [ N("/_File"), undef, undef, undef, '' ], @@ -562,6 +563,9 @@ sub run_treeview_dialog { [ N("/_Options") . N("/_Show automatically selected packages"), undef, sub { $dont_show_selections->[0] = !$checkbox_show_autoselect->get_active; }, undef, '' ], + [ $updates_string, undef, sub { + $::rpmdrake_options{compute_updates} = $check_boxes{$updates_string}->get_active; + }, undef, '' ], ), [ N("/_View"), undef, undef, undef, '' ], (map { @@ -611,8 +615,9 @@ sub run_treeview_dialog { %check_boxes = map { $_ => $factory->get_widget("
" . $get_path->($_)); - } ($auto_string, $noclean_string); + } ($auto_string, $noclean_string, $updates_string); $check_boxes{$auto_string}->set_active($::rpmdrake_options{auto}) if !$>; + $check_boxes{$updates_string}->set_active($::rpmdrake_options{compute_updates}) if !$>; $check_boxes{$noclean_string}->set_active(!$::noclean); $checkbox_show_autoselect = $factory->get_widget("
" . strip_first_underscore(N("/_Options"), N("/_Show automatically selected packages"))) -- cgit v1.2.1