]> git.openfabrics.org - ~aditr/ofed_scripts.git/commitdiff
install.pl: Added '--without-<package>' parameter support
authorVladimir Sokolovsky <vlad@mellanox.com>
Thu, 23 Jan 2014 11:16:53 +0000 (13:16 +0200)
committerVladimir Sokolovsky <vlad@mellanox.com>
Thu, 23 Jan 2014 11:16:53 +0000 (13:16 +0200)
This is to provide an easy way to avoid package installation.
Number of such parameters can be provided to the install.pl script:
E.g.: ./install.pl --all --without-rds-tools --without-ibacm --without-mthca

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
install.pl

index 31d24674f2c01667f9d9cc0626768ab79846ef84..c152fe3899686fe7fceea38100167ecb9701eecd 100755 (executable)
@@ -117,6 +117,7 @@ my $install_option;
 my $check_linux_deps = 1;
 my $force = 0;
 my $kmp = 1;
+my %disabled_packages;
 
 while ( $#ARGV >= 0 ) {
 
@@ -172,6 +173,10 @@ while ( $#ARGV >= 0 ) {
         $verbose = 1;
         $verbose2 = 1;
         $verbose3 = 1;
+    } elsif ( $cmd_flag =~ /--without|--disable/ ) {
+        my $pckg = $cmd_flag;
+        $pckg =~ s/--without-|--disable-//;
+        $disabled_packages{$pckg} = 1;
     } else {
         &usage();
         exit 1;
@@ -461,6 +466,7 @@ sub usage
    print "\n           --force              Force uninstall RPM coming with Distribution";
    print "\n           --builddir           Change build directory. Default: $builddir";
    print "\n           --umad-dev-rw        Grant non root users read/write permission for umad devices instead of default";
+   print "\n           --without-<package>  Do not install package";
    print "\n\n           --all|--hpc|--basic    Install all,hpc or basic packages correspondingly";
    print RESET "\n\n";
 }
@@ -1940,6 +1946,14 @@ sub set_availability
             }
         }
     }
+
+    for my $key ( keys %disabled_packages ) {
+        if (exists $packages_info{$key}) {
+            $packages_info{$key}{'available'} = 0;
+        } elsif (exists $kernel_modules_info{$key}) {
+            $kernel_modules_info{$key}{'available'} = 0;
+        }
+    }
 }
 
 # Set rpm_exist parameter for existing RPMs