# File lib/chef/provider/package/freebsd.rb, line 40 def port_path case @new_resource.package_name # When the package name starts with a '/' treat it as the full path to the ports directory when /^\// @new_resource.package_name # Otherwise if the package name contains a '/' not at the start (like 'www/wordpress') treat as a relative # path from /usr/ports when /\// "/usr/ports/#{@new_resource.package_name}" # Otherwise look up the path to the ports directory using 'whereis' else whereis = shell_out!("whereis -s #{@new_resource.package_name}", :env => nil) unless path = whereis.stdout[/^#{@new_resource.package_name}:\s+(.+)$/, 1] raise Chef::Exceptions::Package, "Could not find port with the name #{@new_resource.package_name}" end path end end