lib/rconf/configurators/packages_configurator.rb in rconf-0.5.9 vs lib/rconf/configurators/packages_configurator.rb in rconf-0.6.1
- old
+ new
@@ -20,20 +20,22 @@
description 'Installs packages defined for running platform'
settings :debian => 'Packages to be installed on Debian based Linux',
:centos => 'Packages to be installed on RedHat / Centos',
:windows => 'Softwared to be downloaded and installed on Windows',
- :mac => 'Brew packages to be installed on Mac OS X (https://github.com/mxcl/homebrew)'
+ :mac => 'Brew packages to be installed on Mac OS X (https://github.com/mxcl/homebrew)',
+ :abort_on_failure => 'Whether to abort if packages failed to install (false by default)'
# Install debian packages
#
# === Return
# true:: Always return true
def run_linux_ubuntu
return if debian.nil?
report_check("Installing the following packages:\n#{debian.join(' ')}\nThis could take a while")
- opts = debian << { :abort_on_failure => 'Failed to install packages' }
+ opts = debian.dup
+ opts << { :abort_on_failure => 'Failed to install packages' } if abort_on_failure
Command.execute('sudo', 'aptitude', 'install', *opts)
report_success
end
alias :run_linux_debian :run_linux_ubuntu
@@ -42,10 +44,11 @@
# === Return
# true:: Always return true
def run_linux_centos
return if centos.nil?
report_check("Installing the following packages:\n#{centos.join(' ')}\nThis could take a while")
- opts = centos << { :abort_on_failure => 'Failed to install packages' }
+ opts = centos.dup
+ opts << { :abort_on_failure => 'Failed to install packages' } if abort_on_failure
Command.execute('sudo', 'yum', 'install', '-y', *opts)
report_success
end
alias :run_linux_redhat :run_linux_centos