summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-02-18 12:58:06 +0000
committerThierry Vignaud <tv@mandriva.org>2009-02-18 12:58:06 +0000
commit78b3bc4105484cd413c16f61d3d91e34eab5ad11 (patch)
tree33def4a1e68c7f4db8317f8dcea6168bbc932322
parenta1cb50ec46383cfd33d2b8b61eb316ab661c29ff (diff)
downloaddrakx-78b3bc4105484cd413c16f61d3d91e34eab5ad11.tar
drakx-78b3bc4105484cd413c16f61d3d91e34eab5ad11.tar.gz
drakx-78b3bc4105484cd413c16f61d3d91e34eab5ad11.tar.bz2
drakx-78b3bc4105484cd413c16f61d3d91e34eab5ad11.tar.xz
drakx-78b3bc4105484cd413c16f61d3d91e34eab5ad11.zip
(rpmDbOpen) make it more readable
-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);
}