diff options
author | Dave Eddy <dave@daveeddy.com> | 2015-03-29 23:31:40 -0400 |
---|---|---|
committer | Bryan McLellan <btm@chef.io> | 2015-05-01 18:44:48 -0400 |
commit | 5a2ecb9bc39e2926b86c5f154e113292f80d45c9 (patch) | |
tree | 944df0752599233c2e7e26c2f461ed4770bc1ebc /lib | |
parent | c65ec07f280aa310b1bd63f632fc9fce543165ce (diff) | |
download | chef-5a2ecb9bc39e2926b86c5f154e113292f80d45c9.tar.gz |
fix smartos_package for new "pkgin" output, fixes #3112
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/package/smartos.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/provider/package/smartos.rb b/lib/chef/provider/package/smartos.rb index 7cef91953a..bba55ca39e 100644 --- a/lib/chef/provider/package/smartos.rb +++ b/lib/chef/provider/package/smartos.rb @@ -43,7 +43,7 @@ class Chef def check_package_state(name) Chef::Log.debug("#{@new_resource} checking package #{name}") version = nil - info = shell_out!("/opt/local/sbin/pkg_info -E \"#{name}*\"", :env => nil, :returns => [0,1]) + info = shell_out!("/opt/local/sbin/pkg_info", "-E", "#{name}*", :env => nil, :returns => [0,1]) if info.stdout version = info.stdout[/^#{@new_resource.package_name}-(.+)/, 1] @@ -60,11 +60,11 @@ class Chef return @candidate_version if @candidate_version name = nil version = nil - pkg = shell_out!("/opt/local/bin/pkgin se #{new_resource.package_name}", :env => nil, :returns => [0,1]) + pkg = shell_out!("/opt/local/bin/pkgin", "se", new_resource.package_name, :env => nil, :returns => [0,1]) pkg.stdout.each_line do |line| case line when /^#{new_resource.package_name}/ - name, version = line.split[0].split(/-([^-]+)$/) + name, version = line.split(/[; ]/)[0].split(/-([^-]+)$/) end end @candidate_version = version @@ -74,7 +74,7 @@ class Chef def install_package(name, version) Chef::Log.debug("#{@new_resource} installing package #{name} version #{version}") package = "#{name}-#{version}" - out = shell_out!("/opt/local/bin/pkgin -y install #{package}", :env => nil) + out = shell_out!("/opt/local/bin/pkgin", "-y", "install", package, :env => nil) end def upgrade_package(name, version) @@ -85,7 +85,7 @@ class Chef def remove_package(name, version) Chef::Log.debug("#{@new_resource} removing package #{name} version #{version}") package = "#{name}" - out = shell_out!("/opt/local/bin/pkgin -y remove #{package}", :env => nil) + out = shell_out!("/opt/local/bin/pkgin", "-y", "remove", package, :env => nil) end end |