From: Vladimir Sokolovsky Date: Thu, 23 Jan 2014 11:16:53 +0000 (+0200) Subject: install.pl: Added '--without-' parameter support X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=36c60f2919f1d776f72e17ed55fe3ce79fad9d74;p=~aditr%2Fofed_scripts.git install.pl: Added '--without-' parameter support 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 --- diff --git a/install.pl b/install.pl index 31d2467..c152fe3 100755 --- a/install.pl +++ b/install.pl @@ -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- 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