freebsd ports provider is broken in puppetlabs/puppet HEAD?

14 views
Skip to first unread message

rafelt...@ucdavis.edu

unread,
May 4, 2017, 7:12:32 PM5/4/17
to Puppet Developers
Hello,

Today I think I found a bug in the ports provider for FreeBSD:
puppet/lib/puppet/provider/package/ports.rb:7:

:portinfo => "/usr/sbin/pkg_info"

The pkg_info command has been replaced with 'pkg info' as of freebsd 10.0 :
https://wiki.freebsd.org/PkgPrimer

I've made a simple patch for the issue in ports.rb and freebsd.rb, which appears to fix the problem, but would likely break older releases than 10.0 which use the older pkg_info command.  Can I submit a PR as is or do I need to account for older releases?  10.3 is the current oldest supported freebsd release.  

Thanks!
Richard

Branan Riley

unread,
May 4, 2017, 7:23:54 PM5/4/17
to puppe...@googlegroups.com, rafelt...@ucdavis.edu
I think it would be fine to put up the PR as-is, since FreeBSD 9 is EOL.

Thanks for contributing,
Branan Riley
Software Engineer, Puppet

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/1c21454b-7e7e-42a5-b165-429a2ed34237%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rafelt...@ucdavis.edu

unread,
May 5, 2017, 5:29:55 AM5/5/17
to Puppet Developers, rafelt...@ucdavis.edu
Thanks!  Is there a test suite I can run the tree through to make sure my patch is fine before i submit the PR?  First change to the puppet code base itself...

Richard

Michael Smith

unread,
May 5, 2017, 12:21:14 PM5/5/17
to Puppet Developers, rafelt...@ucdavis.edu
You can run rspec. The standard way to do that for Ruby projects is to run `bundle install`, then `bundle exec rspec spec`. You can also rely on the CI systems on pull requests to check your code, but you'll get faster feedback running locally.

Branan Riley

unread,
May 5, 2017, 1:10:10 PM5/5/17
to Puppet Developers, rafelt...@ucdavis.edu
Unfortunately it looks like there actually isn't a spec test for the ports provider right now - https://github.com/puppetlabs/puppet/tree/master/spec/unit/provider/package

If you feel like learning rspec and contributing tests for the provider, that would be awesome. Otherwise I think that this is going to be a sufficiently obvious change that we don't need to worry about it.

--
Branan Riley
Software Engineer, Puppet
Reply all
Reply to author
Forward
0 new messages