aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-09-13 10:25:04 +0000
committerThierry Vignaud <tv@mandriva.org>2007-09-13 10:25:04 +0000
commit3bcc9a34c58ef09202026022b710d0c19713a77e (patch)
tree2bd9a7318f3ea4a6ac419da5cef6d3d52e78144d /Rpmdrake
parentfbee0014b5ac43410a22ee6493ce6c1ca299cca9 (diff)
downloadrpmdrake-3bcc9a34c58ef09202026022b710d0c19713a77e.tar
rpmdrake-3bcc9a34c58ef09202026022b710d0c19713a77e.tar.gz
rpmdrake-3bcc9a34c58ef09202026022b710d0c19713a77e.tar.bz2
rpmdrake-3bcc9a34c58ef09202026022b710d0c19713a77e.tar.xz
rpmdrake-3bcc9a34c58ef09202026022b710d0c19713a77e.zip
(get_pkgs,warn_about_media) further improve startup time by killing
one more DB opening (#33334); now we open the DB one in rpmdrake case and two in MandrivaUpdate one
Diffstat (limited to 'Rpmdrake')
-rw-r--r--Rpmdrake/pkg.pm16
1 files changed, 9 insertions, 7 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 5f753115..a1ac8940 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -166,8 +166,14 @@ sub warn_about_media {
return if $::rpmdrake_options{'no-media-update'};
# we use our own instance of the urpmi db in order not to mess up with skip-list managment (#31092):
+ # and no need to fully configure urpmi since we may have to do it again anyway because of new media:
my $urpm = fast_open_urpmi_db();
+ my $_lock = urpm::lock::urpmi_db($urpm);
+
+ # build media list:
+ @update_medias = get_update_medias($urpm);
+
# do not update again media after installing/removing some packages:
$::rpmdrake_options{'no-media-update'} ||= 1;
@@ -227,16 +233,12 @@ sub get_pkgs {
my $_gurpm_clean_guard = before_leaving { Rpmdrake::gurpm::end() };
my $_flush_guard = Gtk2::GUI_Update_Guard->new;
- # no need to fully configure urpmi since we may have to do it again anyway because of warn_about_media():
- my $urpm = fast_open_urpmi_db();
- my $_lock = urpm::lock::urpmi_db($urpm);
+ warn_about_media($w, $opts);
- # build media list for warn_about_media():
- @update_medias = get_update_medias($urpm);
+ my $urpm = open_urpmi_db();
- warn_about_media($w, $opts);
+ my $_lock = urpm::lock::urpmi_db($urpm);
- $urpm = open_urpmi_db();
# update media list in case warn_about_media() added some:
@update_medias = get_update_medias($urpm);