aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-02-21 11:30:11 +0000
committerThierry Vignaud <tv@mandriva.org>2007-02-21 11:30:11 +0000
commitd79bb6f01e5e130f6c725c0ef425c2ef27a6f233 (patch)
treeac5ebcaaa1d29aab8276a16714aa94a2fc4bab07
parentaaab59a20ba894b16088fb9f24275ca9f59898bb (diff)
downloadrpmdrake-d79bb6f01e5e130f6c725c0ef425c2ef27a6f233.tar
rpmdrake-d79bb6f01e5e130f6c725c0ef425c2ef27a6f233.tar.gz
rpmdrake-d79bb6f01e5e130f6c725c0ef425c2ef27a6f233.tar.bz2
rpmdrake-d79bb6f01e5e130f6c725c0ef425c2ef27a6f233.tar.xz
rpmdrake-d79bb6f01e5e130f6c725c0ef425c2ef27a6f233.zip
(get_pkgs) enable to speed-up startup time for MandrivaUpdate
-rwxr-xr-xMandrivaUpdate1
-rwxr-xr-xRpmdrake/pkg.pm10
2 files changed, 9 insertions, 2 deletions
diff --git a/MandrivaUpdate b/MandrivaUpdate
index 25a34aaf..ab1f495d 100755
--- a/MandrivaUpdate
+++ b/MandrivaUpdate
@@ -117,6 +117,7 @@ gtknew('ScrolledWindow', width => $typical_width*0.9,
$w->{rwindow}->show_all;
$w->{rwindow}->set_sensitive(0);
+ $Rpmdrake::pkg::probe_only_for_updates = 1; # faster startup
pkgs_provider({}, $default_list_mode); # default mode
# select packages to update:
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 7bb24cdd..fe8a5315 100755
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -174,6 +174,7 @@ sub formatlistpkg { join("\n", sort { uc($a) cmp uc($b) } @_) }
# -=-=-=---=-=-=---=-=-=-- install packages -=-=-=---=-=-=---=-=-=-
+our $probe_only_for_updates;
sub get_pkgs {
my ($urpm, $opts) = @_;
my $update_name = 'update_source';
@@ -322,6 +323,7 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1);
Rpmdrake::gurpm::progress($level = 0.33);
$reset_update->(0.66);
my %installed_pkgs;
+ if (!$probe_only_for_updates) {
$db->traverse(sub {
my ($pkg) = @_;
$update->();
@@ -343,6 +345,8 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1);
urpm::media::configure($urpm, parallel => $group);
}
+ }
+
# find out availlable packages:
#$urpm = urpm->new;
@@ -365,8 +369,10 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1);
start => 0,
end => $#{$urpm->{depslist}},
);
- $urpm->compute_installed_flags($db); # TODO/FIXME: not for updates
- $urpm->{depslist}[$_]->set_flag_installed foreach keys %$requested; #- pretend it's installed
+ if (!$probe_only_for_updates) {
+ $urpm->compute_installed_flags($db); # TODO/FIXME: not for updates
+ $urpm->{depslist}[$_]->set_flag_installed foreach keys %$requested; #- pretend it's installed
+ }
$urpm->{rpmdrake_state} = $state; #- Don't forget it
Rpmdrake::gurpm::progress($level = 0.7);