[PUP-7632] FreeBSD package providers are outdated Created: 2017/06/08  Updated: 2019/04/04

Status: Accepted
Project: Puppet
Component/s: None
Affects Version/s: PUP 4.10.1
Fix Version/s: None

Type: Improvement Priority: Normal
Reporter: Helmut Ritter Assignee: Helmut Ritter
Resolution: Unresolved Votes: 0
Labels: freebsd, help_wanted, package, type_and_provider
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

FreeBSD BSDHelmut.charlieroot.de 10.3-RELEASE-p17 FreeBSD 10.3-RELEASE-p17 #3 r315512: Sat Mar 18 23:07:14 CET 2017 root@BSDHelmut.charlieroot.de:/usr/obj/usr/src/sys/GENERIC-PF-ALTQ amd64


Template:
Team: Platform OS
QA Risk Assessment: Needs Assessment

 Description   

Hi,

the FreeBSD package providers "ports" and "portupgrade" are outdated as they use "pkg_info" instead of "pkg info":

https://wiki.freebsd.org/pkgng

I would like to offer my support here but due to the lack of ruby knowledge I cannot do this myself.

My current workaround is to create /usr/sbin/pkg_info with the following content:

#!/bin/sh
CMD="$(echo ${@} | sed -e 's#Q#q#g' -e 's#O#o#g')"
/usr/sbin/pkg info ${CMD}

Helmut



 Comments   
Comment by Josh Cooper [ 2017/06/08 ]

Hi Helmut, puppet has a pkgng package provider for FreeBSD, but we do not have systems to test against in-house, so it may need some attention and updating. Could you take a look and either close this ticket or update it with information about what isn't working?

Comment by Helmut Ritter [ 2017/06/09 ]

Hello Josh,

      package { $package:
        ensure => installed,
#        provider => 'ports'
        provider => 'portupgrade'
#        provider => 'pkgng'
      }

pkg_info does not exist (is deprecated since FreeBSD >=10) which results in

Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/sbin/pkg_info does not exist
Error: /Package[dovecot2]: Provider portupgrade is not functional on this host
Error: /Package[fetchmail]: Provider portupgrade is not functional on this host
Error: /Package[mysql56-server]: Provider portupgrade is not functional on this host
Error: /Package[nagios4]: Provider portupgrade is not functional on this host
Error: /Package[p5-Class-Accessor]: Provider portupgrade is not functional on this host
Error: /Package[p5-Config-IniFiles]: Provider portupgrade is not functional on this host
Error: /Package[p5-Date-Manip]: Provider portupgrade is not functional on this host
Error: /Package[p5-DBD-mysql]: Provider portupgrade is not functional on this host
Error: /Package[p5-DBI]: Provider portupgrade is not functional on this host
Error: /Package[p5-List-MoreUtils]: Provider portupgrade is not functional on this host
Error: /Package[p5-MIME-Lite]: Provider portupgrade is not functional on this host
Error: /Package[p5-NetAddr-IP]: Provider portupgrade is not functional on this host
Error: /Package[p5-perl-ldap]: Provider portupgrade is not functional on this host
Error: /Package[p5-Socket]: Provider portupgrade is not functional on this host
Error: /Package[p5-Socket6]: Provider portupgrade is not functional on this host
Error: /Package[p5-Net-Telnet]: Provider portupgrade is not functional on this host
Error: /Package[spamass-iXhash]: Provider portupgrade is not functional on this host
Error: /Package[vsftpd-ssl]: Provider portupgrade is not functional on this host
Error: /Package[open-vm-tools-nox11]: Provider portupgrade is not functional on this host
Error: /Package[portupgrade]: Provider portupgrade is not functional on this host
Error: /Package[py27-fail2ban]: Provider portupgrade is not functional on this host
Error: /Package[subversion]: Provider portupgrade is not functional on this host
Error: /Package[bash]: Provider portupgrade is not functional on this host
Error: /Package[tmux]: Provider portupgrade is not functional on this host

In /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/package/portupgrade.rb:

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

pkg_info is deprecated, it should be

:portinfo      => "/usr/sbin/pkg info"

Same for /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/package/ports.rb

When calling "pkg info" the options changed slightly, instead of

cmdline = ["-aoQ"]

it must be

cmdline = ["-aOq"]

See also https://wiki.freebsd.org/PkgPrimer

The same applies to

:portuninstall => "/usr/local/sbin/pkg_deinstall",

This must be "pkg remove" or "pkg deinstall".

Generated at Mon Dec 16 03:19:44 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.