diff options
author | Dimitri Aivaliotis <aglarond@gmail.com> | 2012-03-23 22:08:30 +0100 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2012-04-26 13:15:48 -0700 |
commit | e84bc9c2f55890a424dcf68af74a14a7676142ac (patch) | |
tree | 93ab2c771b88f09adef62a5e02ac3137ce38f895 /chef/lib | |
parent | b4920aa5e4693bc008fa75ae8d02675a764b662f (diff) | |
download | chef-e84bc9c2f55890a424dcf68af74a14a7676142ac.tar.gz |
[CHEF-1251] fixed package provider for the case with no port tree
Diffstat (limited to 'chef/lib')
-rw-r--r-- | chef/lib/chef/provider/package/freebsd.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/chef/lib/chef/provider/package/freebsd.rb b/chef/lib/chef/provider/package/freebsd.rb index acd470b72c..c4657c645a 100644 --- a/chef/lib/chef/provider/package/freebsd.rb +++ b/chef/lib/chef/provider/package/freebsd.rb @@ -85,7 +85,12 @@ class Chef begin @candidate_version = ports_candidate_version rescue - @candidate_version = file_candidate_version + if @new_resource.source =~ /^\// + @candidate_version = file_candidate_version + else + # FreeBSD package symlinks take care of the version + @candidate_version = "0.0.0" + end end Chef::Log.debug("#{@new_resource} ports candidate version is #{@candidate_version}") if @candidate_version @@ -115,7 +120,11 @@ class Chef when /^ports$/ shell_out!("make -DBATCH install", :timeout => 1200, :env => nil, :cwd => port_path).status when /^http/, /^ftp/ - shell_out!("pkg_add -r #{package_name}", :env => { "PACKAGESITE" => @new_resource.source, 'LC_ALL' => nil }).status + if @new_resource.source =~ /\/$/ + shell_out!("pkg_add -r #{package_name}", :env => { "PACKAGESITE" => @new_resource.source, 'LC_ALL' => nil }).status + else + shell_out!("pkg_add -r #{package_name}", :env => { "PACKAGEROOT" => @new_resource.source, 'LC_ALL' => nil }).status + end Chef::Log.debug("#{@new_resource} installed from: #{@new_resource.source}") when /^\// shell_out!("pkg_add #{file_candidate_version_path}", :env => { "PKG_PATH" => @new_resource.source , 'LC_ALL'=>nil}).status |