summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 7b2937c16..0b16968d1 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -559,9 +559,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);
}