summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-08-06 02:21:11 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-08-06 02:21:11 +0000
commit5781532bea6e435e4da598260c1e40bc039c4331 (patch)
tree15b47d16eacf8ba4c453f49df1a259fae0953e17
parentfc7ca35bf34f1015b323668261d2a223419f17d7 (diff)
downloaddrakx-backup-do-not-use-5781532bea6e435e4da598260c1e40bc039c4331.tar
drakx-backup-do-not-use-5781532bea6e435e4da598260c1e40bc039c4331.tar.gz
drakx-backup-do-not-use-5781532bea6e435e4da598260c1e40bc039c4331.tar.bz2
drakx-backup-do-not-use-5781532bea6e435e4da598260c1e40bc039c4331.tar.xz
drakx-backup-do-not-use-5781532bea6e435e4da598260c1e40bc039c4331.zip
don't try to remove non existing should_be_dirs
-rw-r--r--perl-install/install_steps.pm13
1 files changed, 5 insertions, 8 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 0db44431d..3479fbbb4 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -368,14 +368,11 @@ sub beforeInstallPackages {
#- mainly for upgrading redhat packages, but it can help other
my @should_not_be_dirs = qw(/usr/X11R6/lib/X11/xkb /usr/share/locale/zh_TW/LC_TIME /usr/include/GL);
my @should_be_dirs = qw(/etc/X11/xkb);
- foreach (@should_not_be_dirs) {
- my $f = "$::prefix$_";
- rm_rf($f) if !-l $f && -d $f;
- }
- foreach (@should_be_dirs) {
- my $f = "$::prefix$_";
- rm_rf($f) if -l $f || !-d $f;
- }
+ my @to_remove = (
+ (grep { !-l $f && -d $f } map { "$::prefix$_" } @should_not_be_dirs),
+ (grep { -l $f || !-d $f && -e $f } map { "$::prefix$_" } @should_be_dirs),
+ );
+ rm_rf(@to_remove);
if ($o->{isUpgrade} eq 'redhat') {
upgrading_redhat();