saltstack/salt — pull request #7438 by terminalmage (2013-09-24 23:44:51+00:00)
Title: Rewrite FreeBSD package management

Before this rewrite, there was a module called ``freebsdpkg`` which would handle installing packages using pkg_add. However, it would also check for the existence of a pkgng database, and if found it would attempt to use pkg instead of pkg_add. The trouble with this is that both the pkg_add and pkg support was not quite fully-implemented in this module. Only confusing things further was the fact that there has for a while existed a ``pkgng`` module, which A) was not recognized as a provider for ``pkg`` states, and B) had an incomplete API implementation and could thus not be used properly in states.

My rewrite does the following:

1. The freebsdpkg module ([salt/modules/freebsdpkg.py](https://github.com/terminalmage/salt/blob/bsd-pkg-rewrite/salt/modules/freebsdpkg.py)) now implements ONLY pkg_add, and is the default provider for pkg states in FreeBSD 9 and older.
2. The pkgng module ([salt/modules/pkgng.py](https://github.com/terminalmage/salt/blob/bsd-pkg-rewrite/salt/modules/pkgng.py)) is now fully-implemented and is the default provider for pkg states in FreeBSD 10 and newer. FreeBSD 9 users using pkgng will need to override the pkg provider in the minion config file in order to use the pkgng module.