summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-09-17 14:29:08 +0000
committerFrancois Pons <fpons@mandriva.com>2003-09-17 14:29:08 +0000
commitf66f5ce0b2a1abbec4081ea1b11a3bbec8e9be55 (patch)
tree4734fc7c39765bb774ebbbeeca89807057d9db5c
parent845aac0287ca4edd17ea268f38ad99853805f48d (diff)
downloaddrakx-f66f5ce0b2a1abbec4081ea1b11a3bbec8e9be55.tar
drakx-f66f5ce0b2a1abbec4081ea1b11a3bbec8e9be55.tar.gz
drakx-f66f5ce0b2a1abbec4081ea1b11a3bbec8e9be55.tar.bz2
drakx-f66f5ce0b2a1abbec4081ea1b11a3bbec8e9be55.tar.xz
drakx-f66f5ce0b2a1abbec4081ea1b11a3bbec8e9be55.zip
make always sure rpmdb is closed before attempting installation.
-rw-r--r--perl-install/pkgs.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index d58ce2481..bbd260511 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -926,10 +926,10 @@ sub install($$$;$$) {
my ($prefix, $isUpgrade, $toInstall, $packages) = @_;
my %packages;
- return if $::g_auto_install || !scalar(@$toInstall);
-
delete $packages->{rpmdb}; #- make sure rpmdb is closed before.
+ return if $::g_auto_install || !scalar(@$toInstall);
+
#- for root loopback'ed /boot
my $loop_boot = loopback::prepare_boot();
@@ -1146,9 +1146,10 @@ sub install($$$;$$) {
sub remove {
my ($prefix, $toRemove, $packages) = @_;
+ delete $packages->{rpmdb}; #- make sure rpmdb is closed before.
+
return if $::g_auto_install || !@{$toRemove || []};
- delete $packages->{rpmdb}; #- make sure rpmdb is closed before.
my $db = rpmDbOpenForInstall($prefix) or die "error opening RPM database: ", c::rpmErrorString();
my $trans = $db->create_transaction($prefix);