aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-06-13 13:55:38 +0000
committerThierry Vignaud <tv@mandriva.org>2007-06-13 13:55:38 +0000
commit27b1131d2ec55f6680e0b381e625944193fe571c (patch)
tree8643aedd1cacec50f724afbd295040112bb88025
parent1d2401044c5616361da5b8c9394b5e78f3874e8a (diff)
downloadrpmdrake-27b1131d2ec55f6680e0b381e625944193fe571c.tar
rpmdrake-27b1131d2ec55f6680e0b381e625944193fe571c.tar.gz
rpmdrake-27b1131d2ec55f6680e0b381e625944193fe571c.tar.bz2
rpmdrake-27b1131d2ec55f6680e0b381e625944193fe571c.tar.xz
rpmdrake-27b1131d2ec55f6680e0b381e625944193fe571c.zip
(open_urpmi_db) split it out of get_pkgs()
-rwxr-xr-xRpmdrake/pkg.pm25
1 files changed, 16 insertions, 9 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index cc628b75..9f215d60 100755
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -217,17 +217,9 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1);
}
}
-our $probe_only_for_updates;
-sub get_pkgs {
- my ($opts) = @_;
- my %update_descr;
- @update_medias = ();
- my $w = $::main_window;
- Rpmdrake::gurpm::init(1 ? N("Please wait") : N("Package installation..."), N("Initializing..."), transient => $::main_window);
- my $_guard = before_leaving { Rpmdrake::gurpm::end() };
- my $_flush_guard = Gtk2::GUI_Update_Guard->new;
+sub open_urpmi_db() {
my $error_happened;
my $urpm = urpm->new;
$urpm->{fatal} = sub {
@@ -241,7 +233,22 @@ sub get_pkgs {
touch('/etc/urpmi/urpmi.cfg');
exec('edit-urpm-sources.pl');
}
+ $urpm;
+}
+
+
+our $probe_only_for_updates;
+sub get_pkgs {
+ my ($opts) = @_;
+ my %update_descr;
+ @update_medias = ();
+ my $w = $::main_window;
+
+ Rpmdrake::gurpm::init(1 ? N("Please wait") : N("Package installation..."), N("Initializing..."), transient => $::main_window);
+ my $_guard = before_leaving { Rpmdrake::gurpm::end() };
+ my $_flush_guard = Gtk2::GUI_Update_Guard->new;
+ my $urpm = open_urpmi_db();
my $_lock = urpm::lock::urpmi_db($urpm);
my $statedir = $urpm->{statedir};
@update_medias = grep { !$_->{ignore} && $_->{update} } @{$urpm->{media}};