summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm/sys.pm5
-rwxr-xr-xurpmi2
2 files changed, 6 insertions, 1 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm
index da7736d9..6d2cdec1 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -108,6 +108,11 @@ sub find_mntpoints {
@mntpoints;
}
+sub clean_rpmdb_shared_regions {
+ my ($prefix) = @_;
+ unlink glob("$prefix/var/lib/rpm/__db.*");
+}
+
sub proc_mounts() {
my @l = cat_('/proc/mounts') or warn "Can't read /proc/mounts: $!\n";
@l;
diff --git a/urpmi b/urpmi
index 3fe9e833..52e8f6a2 100755
--- a/urpmi
+++ b/urpmi
@@ -329,7 +329,7 @@ if ($options{previous_priority_upgrade}) {
require urpm::sys;
urpm::sys::fix_fd_leak();
# also, clean up rpm db log files, because rpm might have been upgraded
- unlink glob('/var/lib/rpm/__db.*') unless $urpm->{root};
+ urpm::sys::clean_rpmdb_shared_regions('') if $urpm->{root};
}
my $urpmi_lock = !$env && !$options{nolock} && urpm::lock::urpmi_db($urpm, '', wait => $options{wait_lock});