summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorScott Bonds <scott@ggr.com>2014-11-03 14:28:36 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-11-13 13:09:16 -0800
commitd5fc01256de335ab3d29d850ed3cbf16d40191de (patch)
treebf6180082009af733c89123f166d8ad9e24f1e41 /lib/chef
parent01da76c90f63de1012a1799e9a2921f042539ac9 (diff)
downloadchef-d5fc01256de335ab3d29d850ed3cbf16d40191de.tar.gz
use PKG_PATH instead of PACKAGEROOT/SITE
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/provider/package/openbsd.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/chef/provider/package/openbsd.rb b/lib/chef/provider/package/openbsd.rb
index 476a9689f6..611c0e58f3 100644
--- a/lib/chef/provider/package/openbsd.rb
+++ b/lib/chef/provider/package/openbsd.rb
@@ -38,7 +38,7 @@ class Chef
def initialize(*args)
super
@current_resource = Chef::Resource::Package.new(@new_resource.name)
- @new_resource.source("#{mirror}/pub/#{node.kernel.name}/#{node.kernel.release}/packages/#{node.kernel.machine}/") if !@new_resource.source
+ @new_resource.source(pkg_path) if !@new_resource.source
end
def load_current_resource
@@ -54,11 +54,7 @@ class Chef
if parts = name.match(/^(.+?)--(.+)/)
name = parts[1]
end
- if @new_resource.source =~ /\/$/
- shell_out!("pkg_add -r #{name}#{version_string}", :env => { "PACKAGESITE" => @new_resource.source, 'LC_ALL' => nil }).status
- else
- shell_out!("pkg_add -r #{name}#{version_string}", :env => { "PACKAGEROOT" => @new_resource.source, 'LC_ALL' => nil }).status
- end
+ shell_out!("pkg_add -r #{name}#{version_string}", :env => {"PKG_PATH" => @new_resource.source}).status
Chef::Log.debug("#{@new_resource} installed from: #{@new_resource.source}")
end
end
@@ -101,8 +97,8 @@ class Chef
end
end
- def mirror
- 'http://ftp.eu.openbsd.org'
+ def pkg_path
+ ENV['PKG_PATH'] || "http://ftp.OpenBSD.org/pub/#{node.kernel.name}/#{node.kernel.release}/packages/#{node.kernel.machine}/"
end
end