Giter Club home page Giter Club logo

Comments (6)

adrienthebo avatar adrienthebo commented on September 25, 2024

http://wiki.gentoo.org/wiki//etc/portage/env indicates that file format would be bash environment variables, correct? Could you provide an example of how you would expect to use a package_env resource?

from puppet-portage.

AdmiralNemo avatar AdmiralNemo commented on September 25, 2024

Yes, files in /etc/portage/env are just bash environment variables. I typically only put one variable per file, but by no means is that a requirement, as the wiki shows in the first example. Files in /etc/portage/package.env/ then look exactly like those in /etc/portage/package.use, except instead of USE flags, they contain references to the files in /etc/portage/env.

I would thus expect there to be two definitions in Puppet manifests, one to define the file in /etc/portage/env and one to define the file in /etc/portage/package.env.

Here's an example of how I would envision it (given my current limited knowledge of the Puppet language and Ruby in general):

portage::env { 'makeopts-j1':
  ensure  => present,
  target  => 'single-build-thread',
  var     => 'MAKEOPTS',
  content => '-j1',
}

portage::env { 'no-distcc':
  ensure  => present,
  target  => 'no-distcc',
  var     => 'FEATURES',
  content => '-distcc',
}

package_env { 'dev-libs/boost':
  ensure => present
  target => 'boost',
  env   => ['no-distcc', 'single-build-thread'],
}

This would create the following files:

/etc/portage/env/single-build-thread:

# HEADER: This file was autogenerated at Tue Apr 15 15:44:25 -0500 2013
# HEADER: by puppet.  While it can still be managed manually, it
# HEADER: is definitely not recommended.
MAKEOPTS="-j1"

/etc/portage/env/no-distcc:

# HEADER: This file was autogenerated at Tue Apr 15 15:44:25 -0500 2013
# HEADER: by puppet.  While it can still be managed manually, it
# HEADER: is definitely not recommended.
FEATURES="-distcc"

/etc/portage/package.env/boost:

# HEADER: This file was autogenerated at Tue Apr 15 15:44:25 -0500 2013
# HEADER: by puppet.  While it can still be managed manually, it
# HEADER: is definitely not recommended.
dev-libs/boost no-distcc single-build-thread

I could probably implement this using the concat method like the current portage::makeconf implementation, but I got the feeling from issue #56 that that implementation would be going away.

from puppet-portage.

vikraman avatar vikraman commented on September 25, 2024

package_env is already implemented. For portage::env, just use a file resource?

from puppet-portage.

tampakrap avatar tampakrap commented on September 25, 2024

what is the difference between putting FEATURES="distcc" in /etc/portage/env/no-distcc and /etc/portage/make.conf?

from puppet-portage.

vikraman avatar vikraman commented on September 25, 2024

I tried implementing what op suggested with concat but it doesn't work if we set multiple portage::env resources to have the same target. We could instead have a list of variables set in a single portage::env resource.

from puppet-portage.

tampakrap avatar tampakrap commented on September 25, 2024

not another define please, native types and providers only. If you want to implement that, name it portage_env

from puppet-portage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.