MirBSD manpage: pkg_check(1)

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

Generated on 2021-12-07 11:07:08 by $MirOS: src/scripts/roff2htm,v 1.103 2021/01/23 20:24:35 tg Exp $ — This product includes material provided by mirabilos.

These manual pages and other documentation are copyrighted by their respective writers; their sources are available at the project’s CVSweb, AnonCVS and other mirrors. The rest is Copyright © 2002–2021 MirBSD.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.