diff options
-rw-r--r-- | urpm/sys.pm | 5 | ||||
-rwxr-xr-x | urpmi | 2 |
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; @@ -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}); |