summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-01-30 10:38:53 +0000
committerThierry Vignaud <tv@mandriva.org>2009-01-30 10:38:53 +0000
commitcce69b21e20c533afea49d9d3793c6482fd276b0 (patch)
tree27e1f9d62a49929c9821e8be36f391adc00a30f8
parented4baa5ad538d96913a6d265d4e73838681303ca (diff)
downloaddrakx-backup-do-not-use-cce69b21e20c533afea49d9d3793c6482fd276b0.tar
drakx-backup-do-not-use-cce69b21e20c533afea49d9d3793c6482fd276b0.tar.gz
drakx-backup-do-not-use-cce69b21e20c533afea49d9d3793c6482fd276b0.tar.bz2
drakx-backup-do-not-use-cce69b21e20c533afea49d9d3793c6482fd276b0.tar.xz
drakx-backup-do-not-use-cce69b21e20c533afea49d9d3793c6482fd276b0.zip
(rpmDbOpen) make it more readabletopic/switching_to_urpmi
-rw-r--r--perl-install/install/pkgs.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 054f17d0c..c87257e18 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -534,9 +534,15 @@ sub rpmDbOpen {
} else {
log::l("rebuilding rpm database");
my $rebuilddb_dir = "$::prefix/var/lib/rpmrebuilddb.$$";
- -d $rebuilddb_dir and log::l("removing stale directory $rebuilddb_dir"), rm_rf($rebuilddb_dir);
+ if (-d $rebuilddb_dir) {
+ log::l("removing stale directory $rebuilddb_dir");
+ rm_rf($rebuilddb_dir);
+ }
- URPM::DB::rebuild($::prefix) or log::l("rebuilding of rpm database failed: " . URPM::rpmErrorString()), c::_exit(2);
+ if (!URPM::DB::rebuild($::prefix)) {
+ log::l("rebuilding of rpm database failed: " . URPM::rpmErrorString());
+ c::_exit(2);
+ }
c::_exit(0);
}