summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/urpm.pm b/urpm.pm
index 8adaadbf..1280ceb3 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2217,12 +2217,13 @@ sub install_logger {
sub install {
my ($urpm, $remove, $install, $upgrade, %options) = @_;
my $db = URPM::DB::open($urpm->{root}, !$options{test}); #- open in read/write mode unless testing installation.
+
+ $db or $urpm->{fatal}(_"unable to open rpmdb");
+
my $trans = $db->create_transaction($urpm->{root});
my ($update, @l, %file2pkg) = (0);
local *F;
- $db or $urpm->{fatal}(_"unable to open rpmdb");
-
foreach (@$remove) {
$trans->remove($_) or $urpm->{error}(_("unable to remove package %s", $_));
}