From 3bcc9a34c58ef09202026022b710d0c19713a77e Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 13 Sep 2007 10:25:04 +0000 Subject: (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 --- Rpmdrake/pkg.pm | 16 +++++++++------- 1 file 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); -- cgit v1.2.1