diff options
-rw-r--r-- | perl-install/install/pkgs.pm | 10 |
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); } |