]> git.openfabrics.org - ~emulex/ofed_scripts/.git/commitdiff
install.pl: check if there are installed previous OFED rpms and remove them.
authorVladimir Sokolovsky <vlad@mellanox.co.il>
Sun, 28 Oct 2007 15:06:21 +0000 (17:06 +0200)
committerVladimir Sokolovsky <vlad@mellanox.co.il>
Sun, 28 Oct 2007 15:06:21 +0000 (17:06 +0200)
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
install.pl

index 96cac8d3ae7ee0245f5e2fe972ce4aa29253dcd5..794392ed893d3dea23ecf2079c1d93c666036ca6 100755 (executable)
@@ -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;
         }
     }
 }