From 5781532bea6e435e4da598260c1e40bc039c4331 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 6 Aug 2004 02:21:11 +0000 Subject: don't try to remove non existing should_be_dirs --- perl-install/install_steps.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'perl-install/install_steps.pm') 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(); -- cgit v1.2.1