‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Wednesday, March 27, 2019 2:58 PM, Anton Lindqvist <an...@openbsd.org> wrote:
> 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 Hi Anton I should have been more specific, my use case completes the check in two steps 1. find out whats installed, builds a list of packages 2. install whats not installed. I used autoconf as it is a problem package, git and gmp would also be packages of concerned, but shells/bash and sysutils/coreutils are not a problem, see the output above Cheers Adam