Puppet: System Administration Automated

Support

Ticket #499 (closed enhancement: wontfix)

Opened 2 years ago

Last modified 7 months ago

Support for Gentoo use flags

Reported by: puyo Assigned to: community
Priority: normal Milestone: unplanned
Component: Gentoo Version:
Severity: normal Keywords:
Cc: Triage Stage: Needs design decision
Attached Patches: None Complexity: Medium

Description

Forgive me if there's a way to do this already. I can't seem to find an elegant way to do it.

I tried 2 approaches.

1. Setting the USE environment variable.

package { ssh:
  name => "net-misc/openssh",
  ensure => latest,
  env => 'USE="ldap"'
}

2. Appending entries to /etc/portage/package.use before installing a package.

# got this from somewhere on the net, uses exec, the 
# exec unless argument, grep and sed.
define append_if_no_such_line($file, $line) { ... }

append_if_no_such_line { tracportageuseflags:
  file => "/etc/portage/package.use",
  line => "www-apps/trac sqlite fastcgi vhosts"
}
package { trac:
  ensure => latest,
  require => Append_if_no_such_line[tracportageuseflags]
}

That works, but it's ugly and it will fail or write useless files when $packager != gentoo.

Change History

(follow-up: ↓ 3 ) 02/14/07 10:49:02 changed by jgonzalez

The current recommended approach for this is to handle /etc/portage/package.use as a whole as a file managed by puppet. If Language Evolution#per-provider-parameters are implemented we could discuss about adding use flags as a parameter of the gentoo provider (this has already been discussed in http://mail.madstop.com/pipermail/puppet-dev/2007-February/002790.html).

04/05/07 22:44:35 changed by luke

  • specification set to None.
  • patch set to None.
  • complexity set to Medium.
  • milestone set to unplanned.
  • owner changed from luke to community.
  • approval set to Unnecessary.
  • compatibility set to Unknown.
  • stage set to Needs design decision.

(in reply to: ↑ 1 ) 07/30/07 10:31:46 changed by KillerFox

Replying to jgonzalez:

The current recommended approach for this is to handle /etc/portage/package.use as a whole as a file managed by puppet. If Language Evolution#per-provider-parameters are implemented we could discuss about adding use flags as a parameter of the gentoo provider (this has already been discussed in http://mail.madstop.com/pipermail/puppet-dev/2007-February/002790.html).

Well, I don't think this is a good approach in advance to paludis, an alternative package mangler. Paludis does not support to specify USE-Flags in environment, but manages a file called /etc/paludis/use.conf. It's also possible to define subfiles in the use.conf.d directory which will be included into use.conf as if it were added to the main file. It's also possible there to create bash-script which output will be handles as if it were added to use.conf. So I don't think this is the right behaviour to add USE-Flags; especially, as USE-Flags shouldn't be specified over environment to not break a world-update.

The right way todo it, is to modify the files itself. Well, portage in this case sucks as it manages the global USE-Flags in the file /etc/make.conf and the package-specific in the package.use-File, but maybe to modifiy the USE-Flags we can use euse from the gentoolkit-package. I'm working in advance to paludis to create functions for puppet to modify the USE-Flags as there's no aquivalent to euse and euse does not work with paludis. The “available” file-modification functions does not work well with the USE-Flag format, as there needs to be removed/replaced/added USE-Flag on the same line as the package. The functions would be also useful for the old good known portage-format for package.use, as paludis uses the same with some additions and special cases.

04/24/08 07:40:34 changed by luke

  • component changed from library to Gentoo.
  • summary changed from Gentoo use flags? to Support for Gentoo use flags.

04/24/08 07:41:27 changed by luke

  • status changed from new to closed.
  • resolution set to wontfix.

It seems pretty clear that this isn't the right way to manage use flags for Gentoo, so I'm closing this.