Permalink
Browse files

[GENTOO] Fixed bugs with Portage monkey patch. This needs to be furth…

…er refactored, but installing packages works.
  • Loading branch information...
hosh committed May 11, 2010
1 parent 66ec142 commit f3032614436eb0d344ddde50437f002bd30aafd6
Showing with 11 additions and 10 deletions.
  1. +11 −10 gentoo/libraries/portage.rb
@@ -53,7 +53,8 @@ def conditional_emerge(new_resource, action)
# Set package metadata that may influence our candidate search.
%w(keywords mask unmask).each { |conf_type|
- if conf_flags = new_resource.send(conf)
+ conf_flags = nil
+ if new_resource.respond_to?(conf_type) && conf_flags = new_resource.send(conf_type)
raise Chef::Exceptions::Package, " gentoo_package.#{conf_type} not fully supported yet"
end
}
@@ -64,7 +65,7 @@ def conditional_emerge(new_resource, action)
end
# Setup package-specific USE flags
- if new_resource.use
+ if new_resource.respond_to?(:use) && new_resource.use
manage_package_conf(:create, "use", package_atom, new_resource.use)
end
@@ -74,14 +75,14 @@ def conditional_emerge(new_resource, action)
def package_info_for(package_name)
info = begin
- package_info_from_eix(package_name)
- rescue Chef::Exceptions::Package => err
- Chef::Log.error("Error attempting to use EIX: #{err.inspect}")
- Chef::Log.info("Falling back to portage.")
- package_info_from_portage(package_name)
- end
- info[:package_atom] = full_package_atom(info[:category]. info[:package_name], new_resource.version)
- into
+ package_info_from_eix(package_name)
+ rescue Chef::Exceptions::Package => err
+ Chef::Log.error("Error attempting to use EIX: #{err.inspect}")
+ Chef::Log.info("Falling back to portage.")
+ package_info_from_portage(package_name)
+ end
+ info[:package_atom] = full_package_atom(info[:category], info[:package_name], new_resource.version)
+ info
end
private

0 comments on commit f303261

Please sign in to comment.