diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-09-09 07:52:36 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-09-09 07:52:36 +0000 |
commit | 1a473cb0b77747633cafce9488c6e61930a5aa36 (patch) | |
tree | 2e757368f4900c648cc5a5c72c7a1c39abbb1cb6 | |
parent | 18cc03210e5c4dca75337799c3c4ea796d24e995 (diff) | |
download | urpmi-1a473cb0b77747633cafce9488c6e61930a5aa36.tar urpmi-1a473cb0b77747633cafce9488c6e61930a5aa36.tar.gz urpmi-1a473cb0b77747633cafce9488c6e61930a5aa36.tar.bz2 urpmi-1a473cb0b77747633cafce9488c6e61930a5aa36.tar.xz urpmi-1a473cb0b77747633cafce9488c6e61930a5aa36.zip |
create may_clean_rpmdb_shared_regions()
-rw-r--r-- | urpm/install.pm | 5 | ||||
-rw-r--r-- | urpm/sys.pm | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/urpm/install.pm b/urpm/install.pm index 82f2a481..8007e32b 100644 --- a/urpm/install.pm +++ b/urpm/install.pm @@ -286,10 +286,7 @@ sub install { } unlink @produced_deltas; - if ($urpm->{root} && !$options{test} || $urpm->{tune_rpm}{private}) { - $urpm->{root} && $urpm->{debug} and $urpm->{debug}("workaround bug in rpmlib by removing /var/lib/rpm/__db*"); - urpm::sys::clean_rpmdb_shared_regions($urpm->{root}); - } + urpm::sys::may_clean_rpmdb_shared_regions($urpm, $options{test}); @errors; } diff --git a/urpm/sys.pm b/urpm/sys.pm index cf32d42c..8d671ec3 100644 --- a/urpm/sys.pm +++ b/urpm/sys.pm @@ -108,6 +108,15 @@ sub _expand_symlink { $pdir; } +sub may_clean_rpmdb_shared_regions { + my ($urpm, $test) = @_; + + if ($urpm->{root} && !$test || $urpm->{tune_rpm}{private}) { + $urpm->{root} && $urpm->{debug} and $urpm->{debug}("workaround bug in rpmlib by removing /var/lib/rpm/__db*"); + clean_rpmdb_shared_regions($urpm->{root}); + } +} + sub clean_rpmdb_shared_regions { my ($prefix) = @_; unlink glob("$prefix/var/lib/rpm/__db.*"); |