diff options
-rw-r--r-- | lib/chef/provider/package/solaris.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/chef/provider/package/solaris.rb b/lib/chef/provider/package/solaris.rb index 7b3d4196bc..0f45b61e18 100644 --- a/lib/chef/provider/package/solaris.rb +++ b/lib/chef/provider/package/solaris.rb @@ -107,13 +107,23 @@ class Chef def install_package(name, version) Chef::Log.debug("#{@new_resource} package install options: #{@new_resource.options}") if @new_resource.options.nil? + if ::File.directory?(@new_resource.source) # CHEF-4469 + command = "pkgadd -n -d #{@new_resource.source} #{@new_resource.package_name}" + else + command = "pkgadd -n -d #{@new_resource.source} all" + end run_command_with_systems_locale( - :command => "pkgadd -n -d #{@new_resource.source} all" + :command => command ) Chef::Log.debug("#{@new_resource} installed version #{@new_resource.version} from: #{@new_resource.source}") else + if ::File.directory?(@new_resource.source) # CHEF-4469 + command = "pkgadd -n#{expand_options(@new_resource.options)} -d #{@new_resource.source} #{@new_resource.package_name}" + else + command = "pkgadd -n#{expand_options(@new_resource.options)} -d #{@new_resource.source} all" + end run_command_with_systems_locale( - :command => "pkgadd -n#{expand_options(@new_resource.options)} -d #{@new_resource.source} all" + :command => command ) Chef::Log.debug("#{@new_resource} installed version #{@new_resource.version} from: #{@new_resource.source}") end |