diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-09-12 14:14:34 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-09-12 14:14:34 +0000 |
commit | 697bdfb96eec2f4e17233a011c3454a596511676 (patch) | |
tree | d61f2376dfd0ee5845d43364f78dd8da982fbd7d /Rpmdrake/pkg.pm | |
parent | 134f6cd80d3ce6f59fb6f8cb8a5e10f6cd9cd4a1 (diff) | |
download | rpmdrake-697bdfb96eec2f4e17233a011c3454a596511676.tar rpmdrake-697bdfb96eec2f4e17233a011c3454a596511676.tar.gz rpmdrake-697bdfb96eec2f4e17233a011c3454a596511676.tar.bz2 rpmdrake-697bdfb96eec2f4e17233a011c3454a596511676.tar.xz rpmdrake-697bdfb96eec2f4e17233a011c3454a596511676.zip |
(get_pkgs,warn_about_media) simplify workflow, ensure we never perform
more than 2 costly urpm::media::configure() in worse case and only one
in regular case
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rw-r--r-- | Rpmdrake/pkg.pm | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 45f9b3dc..5f753115 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -210,7 +210,6 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1); $update_name, make_url_mirror($m), 'media_info/synthesis.hdlist.cz', update => 1, ); @update_medias = { name => $update_name }; #- hack to simulate a medium for parsing of descriptions - return 1; } } @@ -228,18 +227,18 @@ sub get_pkgs { my $_gurpm_clean_guard = before_leaving { Rpmdrake::gurpm::end() }; my $_flush_guard = Gtk2::GUI_Update_Guard->new; - my $urpm = open_urpmi_db(); + # 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); # build media list for warn_about_media(): @update_medias = get_update_medias($urpm); - if (warn_about_media($w, $opts)) { - # reread db since it has been reconfigured: - $urpm = open_urpmi_db(); - # update media list in case warn_about_media() added some: - @update_medias = get_update_medias($urpm); - } + warn_about_media($w, $opts); + + $urpm = open_urpmi_db(); + # update media list in case warn_about_media() added some: + @update_medias = get_update_medias($urpm); Rpmdrake::gurpm::label(N("Reading updates description")); Rpmdrake::gurpm::progress(0.05); |