xaque208/puppet-pkgng — pull request #16 by tdb (2013-11-12 23:16:34+00:00)
Title: Improve pkg detection.

This is based on the section in the pkg manpage:

The following script is the safest way to detect if pkg is installed
and activated:

if TMPDIR=/dev/null ASSUME_ALWAYS_YES=1 \
PACKAGESITE=file:///nonexistent \
pkg info pkg >/dev/null 2>&1; then
# pkgng-specifics
else
# pkg_install-specifics
fi

This fits my workload better.