summaryrefslogtreecommitdiff
path: root/lib/chef/provider/package/macports.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-08-29 15:47:58 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-09-08 11:10:05 -0700
commit342201b4e3ad90a0a5ddc62a1e4db76e95aea7e2 (patch)
treed4a2d6d86df86eab92532d67c732d03e14665bc7 /lib/chef/provider/package/macports.rb
parentd6f6928fd1097709189cd78689e89032d4c9318d (diff)
downloadchef-342201b4e3ad90a0a5ddc62a1e4db76e95aea7e2.tar.gz
fix shell_out/run_command usage
- run_command is deprecated - shell_out! should be used for internal APIs (enable/disable/status) - shell_out_with_systems_locale! should be used for start/stop/restart/reload cases (users will want their software running in their systems locale not our forced en_US.UTF-8 locale)
Diffstat (limited to 'lib/chef/provider/package/macports.rb')
-rw-r--r--lib/chef/provider/package/macports.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/chef/provider/package/macports.rb b/lib/chef/provider/package/macports.rb
index 6ef303ee4f..05247e6d31 100644
--- a/lib/chef/provider/package/macports.rb
+++ b/lib/chef/provider/package/macports.rb
@@ -45,27 +45,21 @@ class Chef
unless @current_resource.version == version
command = "port#{expand_options(@new_resource.options)} install #{name}"
command << " @#{version}" if version and !version.empty?
- run_command_with_systems_locale(
- :command => command
- )
+ shell_out!(command)
end
end
def purge_package(name, version)
command = "port#{expand_options(@new_resource.options)} uninstall #{name}"
command << " @#{version}" if version and !version.empty?
- run_command_with_systems_locale(
- :command => command
- )
+ shell_out!(command)
end
def remove_package(name, version)
command = "port#{expand_options(@new_resource.options)} deactivate #{name}"
command << " @#{version}" if version and !version.empty?
- run_command_with_systems_locale(
- :command => command
- )
+ shell_out!(command)
end
def upgrade_package(name, version)
@@ -78,9 +72,7 @@ class Chef
# that hasn't been installed.
install_package(name, version)
elsif current_version != version
- run_command_with_systems_locale(
- :command => "port#{expand_options(@new_resource.options)} upgrade #{name} @#{version}"
- )
+ shell_out!( "port#{expand_options(@new_resource.options)} upgrade #{name} @#{version}" )
end
end