PKG_CHECK(1) BSD Reference Manual PKG_CHECK(1)
NAME
pkg_check - shell interface to pkgtools matching routines
SYNOPSIS
pkg_check version1 op version2
pkg_check [-q] -m pattern pkgname ...
DESCRIPTION
The pkg_check command provides functions to check package versions in
MirPorts. It is meant to be called from scripts, not directly from the
command line.
There are two distinct modes of operation. The first one, which takes
three arguments, compares the two version strings version1 and version2.
The second argument, the operator, is one of <, >, <=, >= or the text
equivalents lt, gt, le and ge. The exit code is 0 if the comparison is
true or 1 if it is false.
The second mode allows to check whether one or more package names pkgname
match the pattern given as the argument to the -m flag. Unless -q (quiet)
is given, the matching package names are written to standard output, one
per line. The exit status is 0 if there was at least one match, 1 other-
wise.
EXAMPLES
pkg_check 1.4.5 ge 2.0
returns 1.
pkg_check 23.42-0 '<' 23.42-5
returns 0.
pkg_check -m 'autoconf->=2.50' autoconf-2.13 autoconf-2.62
prints "autoconf-2.62".
SEE ALSO
pkg_add(1), pkg_info(1), ports(7).
HISTORY
The pkg_check utility was introduced into The MirPorts Framework by
Benny Siegert <bsiegert@mirbsd.org>.
MirBSD #10-current September 4, 2020 1