summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm6
-rw-r--r--urpm/install.pm4
-rw-r--r--urpm/select.pm6
-rwxr-xr-xurpmi2
4 files changed, 12 insertions, 6 deletions
diff --git a/urpm.pm b/urpm.pm
index 06b74537..41852e0a 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -224,6 +224,12 @@ sub is_cdrom_url {
protocol_from_url($url) eq 'cdrom';
}
+sub db_open_or_die_ {
+ my ($urpm, $b_write_perm) = @_;
+ db_open_or_die($urpm, $urpm->{root}, $b_write_perm);
+}
+
+# please use higher level function db_open_or_die_()
sub db_open_or_die {
my ($urpm, $root, $b_write_perm) = @_;
diff --git a/urpm/install.pm b/urpm/install.pm
index a48fbf7c..bd45298e 100644
--- a/urpm/install.pm
+++ b/urpm/install.pm
@@ -43,7 +43,7 @@ sub build_transaction_set_ {
$db = new URPM;
$db->parse_synthesis($options{rpmdb});
} else {
- $db = urpm::db_open_or_die($urpm, $urpm->{root});
+ $db = urpm::db_open_or_die_($urpm);
}
my $sig_handler = sub { undef $db; exit 3 };
@@ -146,7 +146,7 @@ sub install {
my ($urpm, $remove, $install, $upgrade, %options) = @_;
$options{translate_message} = 1;
- my $db = urpm::db_open_or_die($urpm, $urpm->{root}, !$options{test}); #- open in read/write mode unless testing installation.
+ my $db = urpm::db_open_or_die_($urpm, !$options{test}); #- open in read/write mode unless testing installation.
my $trans = $db->create_transaction($urpm->{root});
if ($trans) {
diff --git a/urpm/select.pm b/urpm/select.pm
index f04d3bff..dc663d6f 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -248,7 +248,7 @@ sub resolve_dependencies {
$db = new URPM;
$db->parse_synthesis($options{rpmdb});
} else {
- $db = urpm::db_open_or_die($urpm, $urpm->{root});
+ $db = urpm::db_open_or_die_($urpm);
}
my $sig_handler = sub { undef $db; exit 3 };
@@ -285,7 +285,7 @@ sub resolve_dependencies {
sub select_replacepkgs {
my ($urpm, $state, $requested) = @_;
- my $db = urpm::db_open_or_die($urpm, $urpm->{root});
+ my $db = urpm::db_open_or_die_($urpm);
foreach my $id (keys %$requested) {
my @pkgs = $urpm->find_candidate_packages_($id);
if (my ($pkg) = grep { URPM::is_package_installed($db, $_) } @pkgs) {
@@ -387,7 +387,7 @@ sub find_packages_to_remove {
#- invoke parallel finder.
$urpm->{parallel_handler}->parallel_find_remove($urpm, $state, $l, %options, find_packages_to_remove => 1);
} else {
- my $db = urpm::db_open_or_die($urpm, $urpm->{root});
+ my $db = urpm::db_open_or_die_($urpm);
my (@m, @notfound);
if (!$options{matches}) {
diff --git a/urpmi b/urpmi
index 3cc0400e..3792230c 100755
--- a/urpmi
+++ b/urpmi
@@ -537,7 +537,7 @@ if (@ask_unselect) {
my @ask_remove = $urpm->{options}{'allow-force'} ? @{[]} : urpm::select::removed_packages($urpm, $state);
if (@ask_remove) {
{
- my $db = urpm::db_open_or_die($urpm, $urpm->{root});
+ my $db = urpm::db_open_or_die_($urpm);
urpm::select::find_removed_from_basesystem($urpm, $db, $state, sub {
my $urpm = shift @_;
foreach (@_) {