diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-09-11 15:21:27 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-09-11 15:21:27 +0000 |
commit | 5f97fbb6db8f7789870c8329f0609cc6bd3f6579 (patch) | |
tree | 9df79f85ab4419cae2531e1ed9c365d9616c2c9c /Rpmdrake | |
parent | 08f90b961222590a974642fda6dbb6a62465eaa7 (diff) | |
download | rpmdrake-5f97fbb6db8f7789870c8329f0609cc6bd3f6579.tar rpmdrake-5f97fbb6db8f7789870c8329f0609cc6bd3f6579.tar.gz rpmdrake-5f97fbb6db8f7789870c8329f0609cc6bd3f6579.tar.bz2 rpmdrake-5f97fbb6db8f7789870c8329f0609cc6bd3f6579.tar.xz rpmdrake-5f97fbb6db8f7789870c8329f0609cc6bd3f6579.zip |
simplify by reusing Rpmdrake::open_db::fast_open_urpmi_db()
Diffstat (limited to 'Rpmdrake')
-rw-r--r-- | Rpmdrake/edit_urpm_sources.pm | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm index 5f4b800d..dc4c134a 100644 --- a/Rpmdrake/edit_urpm_sources.pm +++ b/Rpmdrake/edit_urpm_sources.pm @@ -27,6 +27,7 @@ use strict; use lib qw(/usr/lib/libDrakX); use common; use rpmdrake; +use Rpmdrake::open_db; use URPM::Signature; use POSIX qw(_exit); use MDK::Common::Math qw(max); @@ -97,8 +98,7 @@ sub remove_row { sub easy_add_callback() { # when called on early init by rpmdrake - require Rpmdrake::pkg; - $urpm ||= Rpmdrake::pkg::open_urpmi_db(); + $urpm ||= fast_open_urpmi_db(); my $arch = arch(); $arch = 'i586' if $arch =~ /^i.86$/; @@ -383,8 +383,7 @@ sub options_callback() { } $something_changed = 1; urpm::media::write_config($urpm); - $urpm = urpm->new; - urpm::media::read_config($urpm); + $urpm = fast_open_urpmi_db(); Gtk2->main_quit; }, ), @@ -424,7 +423,8 @@ sub renum_media ($$$) { $urpm->{media}[$rows[$_]] = $media[1 - $_] foreach 0, 1; $model->swap(@iters); $something_changed = 1; - urpm::media::write_config($urpm); $urpm = urpm->new; urpm::media::read_config($urpm); + urpm::media::write_config($urpm); + $urpm = fast_open_urpmi_db(); } sub upwards_callback() { @@ -871,8 +871,7 @@ sub keys_callback() { my $write = sub { $something_changed = 1; urpm::media::write_config($urpm); - $urpm = urpm->new; - urpm::media::read_config($urpm); + $urpm = fast_open_urpmi_db(); $read_conf->(); $media_list->get_selection->signal_emit('changed'); }; @@ -1099,8 +1098,7 @@ sub mainwindow() { my ($name) = @_; $reorder_ok = 0; $something_changed = 1; - $urpm = urpm->new; - urpm::media::read_config($urpm); + $urpm = fast_open_urpmi_db(); if (defined $name) { #- this media must be reconstructed since editing it failed if (my $medium = urpm::media::name2medium($urpm, $name)) { |