Currently Chef::Resource::Package doesn't give us the ability to pass arbitrary attributes that can be used by Chef::Provider::Package::Portage to manipulate the USE & KEYWORDS environment variables.
I can think of three possible routes to follow here, outlined below:
The first is to expand Chef::Resource::Package to accept a hash of environment variables that can be passed to the underlying package providers. This is generic enough, and could be used by other providers as well:
package "net-dns/pdns" do
action :install
environment "USE" => "mysql"
end
The above can then be interpreted by the Portage provider and executed as "USE=mysql emerge net-dns/pdns"
The second could be to implement two new providers specifically for Gentoo, one for manipulating use flags and the other for manipulating keywords (both through the corresponding /etc/portage/package.{use|keywords} files
use "net-dns/pdns" do
flags "mysql"
end
keywords "dev-db/couchdb" do
accept "~x86"
end
The last, and least desirable option would be to expand Chef::Resource::Package to accept 'use' and 'keywords' as attributes, but that blows it open to expansion from every child provider.
Currently Chef::Resource::Package doesn't give us the ability to pass arbitrary attributes that can be used by Chef::Provider::Package::Portage to manipulate the USE & KEYWORDS environment variables.
I can think of three possible routes to follow here, outlined below:
The first is to expand Chef::Resource::Package to accept a hash of environment variables that can be passed to the underlying package providers. This is generic enough, and could be used by other providers as well:
package "net-dns/pdns" do
action :install
environment "USE" => "mysql"
end
The above can then be interpreted by the Portage provider and executed as "USE=mysql emerge net-dns/pdns"
The second could be to implement two new providers specifically for Gentoo, one for manipulating use flags and the other for manipulating keywords (both through the corresponding /etc/portage/package.{use|keywords} files
use "net-dns/pdns" do
flags "mysql"
end
keywords "dev-db/couchdb" do
accept "~x86"
end
The last, and least desirable option would be to expand Chef::Resource::Package to accept 'use' and 'keywords' as attributes, but that blows it open to expansion from every child provider.