#! /bin/sh

/usr/sbin/pkg_info -K /usr/pkg/pkgdb -e '*' | while read pkg; do
	path=`/usr/sbin/pkg_info -K /usr/pkg/pkgdb -Q PKGPATH "$pkg"`
	automatic=`/usr/sbin/pkg_info -K /usr/pkg/pkgdb -Q automatic "$pkg"`
	if [ -z "$automatic" ]; then
		automatic=no
	fi
	echo "$path $pkg $automatic"
done | sort | mail -s "`hostname` `/usr/bin/uname -s`-`/usr/bin/uname -p`-`/usr/bin/uname -r`" pkgsurvey1.0@pkgsrc.org

exit 0
