On Wed, Mar 27, 2019 at 02:24:24AM +0000, Adam Steen wrote: > Hi All > > I need to determine if a package is installed, lets use autoconf as an example > > I can run "pkg_info -mqP" and get back list of packages, i.e. > > devel/autoconf/2.69 > shells/bash > sysutils/coreutils > x11/dmenu > x11/dstat > x11/dwm > . > . > . > devel/git,-main > devel/gmp,-main > sysutils/firmware/intel > sysutils/firmware/inteldrm > . > . > . > sysutils/firmware/uvideo > sysutils/firmware/vmm > > directly comparing "devel/autoconf" with "devel/autoconf/2.69", is it > possible to get pkg_info to report a package without any version or stem > information? > > using https://man.openbsd.org/pkg_info i couldn't find anything that jumps > out, i was hoping not to do any further post processing. > > Cheers > Adam
There could be multiple ways of achieving the same result but I often use the following when scripting package installation: $ env PKG_PATH= pkg_info autoconf >/dev/null && echo installed

