From: Vladimir Sokolovsky Date: Sun, 28 Oct 2007 15:06:21 +0000 (+0200) Subject: install.pl: check if there are installed previous OFED rpms and remove them. X-Git-Tag: vofed-1.3-beta1~27 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=f0bff01582b32f0d9b5a7a0a27462a5367b262e4;p=~emulex%2Fofed_scripts%2F.git install.pl: check if there are installed previous OFED rpms and remove them. Signed-off-by: Vladimir Sokolovsky --- diff --git a/install.pl b/install.pl index 96cac8d..794392e 100755 --- a/install.pl +++ b/install.pl @@ -3249,28 +3249,26 @@ sub uninstall system("yes | $CWD/uninstall.sh > $ofedlogs/ofed_uninstall.log 2>&1"); $res = $? >> 8; $sig = $? & 127; + } + my $cmd = "rpm -e --allmatches"; + for my $package (@all_packages, @hidden_packages, @prev_ofed_packages) { + if (is_installed($package)) { + $cmd .= " $package"; + $cnt ++; + } + } + if ($cnt) { + print "Running $cmd\n" if (not $quiet); + open (LOG, "+>$ofedlogs/ofed_uninstall.log"); + print LOG "Running $cmd\n"; + close LOG; + system("$cmd >> $ofedlogs/ofed_uninstall.log 2>&1"); + $res = $? >> 8; + $sig = $? & 127; if ($sig or $res) { - my $cmd = "rpm -e --allmatches"; - for my $package (@all_packages, @hidden_packages, @prev_ofed_packages) { - if (is_installed($packages_info{$package}{'name'})) { - $cmd .= " $packages_info{$package}{'name'}"; - $cnt ++; - } - } - if ($cnt) { - print "Running $cmd\n" if (not $quiet); - open (LOG, "+>$ofedlogs/ofed_uninstall.log"); - print LOG "Running $cmd\n"; - close LOG; - system("$cmd >> $ofedlogs/ofed_uninstall.log 2>&1"); - $res = $? >> 8; - $sig = $? & 127; - if ($sig or $res) { - print RED "Failed to uninstall the previous installation", RESET "\n"; - print RED "See $ofedlogs/ofed_uninstall.log", RESET "\n"; - exit 1; - } - } + print RED "Failed to uninstall the previous installation", RESET "\n"; + print RED "See $ofedlogs/ofed_uninstall.log", RESET "\n"; + exit 1; } } }