summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-10-02 12:01:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-10-02 12:01:48 +0000
commit01754e05a0ad446288d639c8d94042c7385e1ee9 (patch)
tree3f053cbf8579da230c17bc1cb3579a350446ca8c
parent07c841ffc552cf0d404d2f251a55a1c508511366 (diff)
downloadurpmi-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.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});