Giter Club home page Giter Club logo

Comments (6)

tampakrap avatar tampakrap commented on September 25, 2024

Hi. Not sure what you're asking for. You can create a set in /etc/portage/sets with the file built-in class of puppet, and you can emerge them using either exec or portage::package. Am I missing something here?

from puppet-portage.

p8952 avatar p8952 commented on September 25, 2024

I believe you are mistaken about using portage::package, it rejects them due to them as being in the wrong format.

testsrv ~ # puppet agent --test
err: Failed to apply catalog: Parameter name failed on Package_use[vim-set]: name must be a properly formatted atom, see portage(5) for more information at /etc/puppet/modules/test/manifests/packages.pp:29

portage/lib/puppet/util/portage.rb's valid_package function matches all names against a regex to check that they are in the format of 'category/package' so using the format of '@set' fails.

However changing this regex alone will solve the issue since after that the package name will be rejected by puppet's built in portage provider since it relies on eix lookups to check if a packages is installed.

From my point of view to achieve this either puppet's portage provider needs to be patched to support sets or we need to create a custom type/provider.

from puppet-portage.

tampakrap avatar tampakrap commented on September 25, 2024

Indeed I was mistaken, sorry for that. My opinion is:

  1. We should file a bug upstream about lack of @set format support ( @p8952 wanna handle that?)
  2. We don't need a type/provider in this module for sets, since sets can be created with the file class, and can be installed normally (assuming 1 is fixed)
  3. Upstream portage provider shouldn't have extra checks for package format, portage itself has those checks and I don't see the benefit of adding more. It could just read the errors from portage and act accordingly

@adrienthebo opinions please?

from puppet-portage.

p8952 avatar p8952 commented on September 25, 2024

If possible it would be great to have this supported in the upstream provider, however if @puppetlabs would prefer not to include this functionality I have sent a Pull Request containing a type and provider to install, upgrade, and remove portage sets.

from puppet-portage.

adrienthebo avatar adrienthebo commented on September 25, 2024

With respect to input validation, the important detail is to make sure that errors are clearly reported. If portage can hand over the correct information to Puppet then that's perfect, and if not then the provider itself should do validation so that if the input is bad the user knows what went wrong, why, and how to fix it.

from puppet-portage.

tampakrap avatar tampakrap commented on September 25, 2024

we can continue the discussion in #70, closing as duplicate

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.