diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-10-02 12:01:48 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-10-02 12:01:48 +0000 |
commit | 01754e05a0ad446288d639c8d94042c7385e1ee9 (patch) | |
tree | 3f053cbf8579da230c17bc1cb3579a350446ca8c | |
parent | 07c841ffc552cf0d404d2f251a55a1c508511366 (diff) | |
download | urpmi-01754e05a0ad446288d639c8d94042c7385e1ee9.tar urpmi-01754e05a0ad446288d639c8d94042c7385e1ee9.tar.gz urpmi-01754e05a0ad446288d639c8d94042c7385e1ee9.tar.bz2 urpmi-01754e05a0ad446288d639c8d94042c7385e1ee9.tar.xz urpmi-01754e05a0ad446288d639c8d94042c7385e1ee9.zip |
create urpm::sys::clean_rpmdb_shared_regions() and use it
-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}); |