aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/pkg.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-03-22 23:27:59 +0000
committerThierry Vignaud <tv@mandriva.org>2007-03-22 23:27:59 +0000
commit4b734e511a10adc654a398304a779d9ede75fd14 (patch)
treebf0d800098d6069af5b200662c6721300a1a3d30 /Rpmdrake/pkg.pm
parentd63f1a4fd652bef657be2afc70f500777023f9a6 (diff)
downloadrpmdrake-4b734e511a10adc654a398304a779d9ede75fd14.tar
rpmdrake-4b734e511a10adc654a398304a779d9ede75fd14.tar.gz
rpmdrake-4b734e511a10adc654a398304a779d9ede75fd14.tar.bz2
rpmdrake-4b734e511a10adc654a398304a779d9ede75fd14.tar.xz
rpmdrake-4b734e511a10adc654a398304a779d9ede75fd14.zip
revert r57586:57588, aka do not keep around the rpm db opened, thus making mcc closable again in mcc (#26069)
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rwxr-xr-xRpmdrake/pkg.pm13
1 files changed, 6 insertions, 7 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 1bdc38b6..dd2dd478 100755
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -44,14 +44,13 @@ use urpm::select;
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT = qw(extract_header find_installed_version formatlistpkg get_pkgs open_db parse_compssUsers_flat perform_installation perform_removal run_rpm $db);
+our @EXPORT = qw(extract_header find_installed_version formatlistpkg get_pkgs open_db parse_compssUsers_flat perform_installation perform_removal run_rpm);
use mygtk2 qw(gtknew);
use ugtk2 qw(:all);
use Gtk2::Pango;
use Gtk2::Gdk::Keysyms;
-our $db;
sub parse_compssUsers_flat() {
my (%compssUsers, $category);
@@ -153,9 +152,9 @@ sub open_db {
$done = 1;
print "done.\n";
}
- $db = URPM::DB::open($dblocation) or die "Couldn't open RPM DB";
+ URPM::DB::open($dblocation) or die "Couldn't open RPM DB";
} else {
- $db = URPM::DB::open or die "Couldn't open RPM DB";
+ URPM::DB::open or die "Couldn't open RPM DB";
}
}
@@ -163,7 +162,7 @@ sub open_db {
sub find_installed_version {
my ($p) = @_;
my @version;
- $db->traverse_tag('name', [ $p->name ], sub { push @version, $_[0]->version . '-' . $_[0]->release });
+ open_db()->traverse_tag('name', [ $p->name ], sub { push @version, $_[0]->version . '-' . $_[0]->release });
@version ? join(',', sort @version) : N("(none)");
}
@@ -303,7 +302,7 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1);
my @base = ("basesystem", split /,\s*/, $urpm->{global_config}{'prohibit-remove'});
my (%base, %basepackages);
- my $db = $db;
+ my $db = open_db();
my $sig_handler = sub { undef $db; exit 3 };
local $SIG{INT} = $sig_handler;
local $SIG{QUIT} = $sig_handler;
@@ -475,7 +474,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
# select packages to install for !update mode:
if (!$probe_only_for_updates) {
- $urpm->resolve_requested($db, $state, { map { $_->id => undef } grep { $_->flag_selected } @{$urpm->{depslist}} }, callback_choices => \&Rpmdrake::gui::callback_choices);
+ $urpm->resolve_requested(open_db(), $state, { map { $_->id => undef } grep { $_->flag_selected } @{$urpm->{depslist}} }, callback_choices => \&Rpmdrake::gui::callback_choices);
}
my ($local_sources, $list) = urpm::get_pkgs::selected2list($urpm,