From owner-freebsd-current@FreeBSD.ORG Sat May 1 05:00:34 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 219DE16A4D5 for ; Sat, 1 May 2004 05:00:34 -0700 (PDT) Received: from fillmore.dyndns.org (port-212-202-49-130.reverse.qsc.de [212.202.49.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id B86B143D39 for ; Sat, 1 May 2004 05:00:33 -0700 (PDT) (envelope-from eikemeier@fillmore-labs.com) Received: from [172.16.0.2] (helo=fillmore-labs.com) by fillmore.dyndns.org with esmtp (Exim 4.32; FreeBSD) id 1BJtAV-000O0d-8R for current@freebsd.org; Sat, 01 May 2004 14:00:33 +0200 Message-ID: <4093915F.4090403@fillmore-labs.com> Date: Sat, 01 May 2004 14:00:31 +0200 From: Oliver Eikemeier Organization: Fillmore Labs GmbH - http://www.fillmore-labs.com/ MIME-Version: 1.0 To: FreeBSD -CURRENT Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit User-Agent: KMail/1.5.9 Subject: pkg_install patches for review / testing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2004 12:00:34 -0000 This patch add the following features to the pkg_install suite of tools: * new flags: -X: use extended regular expression instead of basic ones (pkg_info, pkg_delete, pkg_version) (PR 56961) -S: specify a base directory where files to package could be found (pkg_create) useful for clean room packaging: (PR 66032) -E: show only matching package names and set the return code (pkg_info) (PR 56961) -r: show packages this packages depends on (documentation change) (pkg_info) (PR 56989) -j: show the requirements script (new functionality) (pkg_info) (PR 56989) -T: test if string matches a glob pattern, setting the exit code accordingly (pkg_version) (PR 56961) * use absolute paths in all calls of external programs, to account for strange PATHs and be able to do env PATH= /usr/local/sbin/pkg_version -v * fix verbose output of pkg_info when used on packages (PR 56989) * pkg_add spawns itself as argv[0] when installing dependent packages, to enable the use as a port. * use INDEX or INDEX-5 depending on FreeBSD version, to enable the use on FreeBSD 4.x as a port. (PR 56961) * better handling of corrupt entries in /var/db/pkg, differ between corrupt entires and packages not installed (PR 57016, 57029) * record checksums for special files (/var/db/pkg entries) in packages (checked with pkg_info -g, backwards compatible) * parse version numbers of ports containing and underscore followed by a number correctly (PR 56961) * enable the use of csh-style {...} choices in glob patterns, e.g. /usr/local/sbin/pkg_info 'openldap-{client,server}-*' * use glob patterns when matching packages by origin, for example /usr/local/sbin/pkg_info -O 'net/*' * enable the use of relational comparisons everywhere a package is matched by a pattern, i.e. pkg_info 'apache>=2.0' instead of 'apache-2.*' (PR 56961) * completely rewritten version number handling, which should be more compatible to what 4.x tools and portupgrade does and generally give the expected results. A new version number definition has been formulated which matches the current usage in the ports tree. Basically, version numbers are composed out of number-letter-number triples, with optional parts. `*' is a special component that is guaranteed to sort before every other component, so that `>=2.*<3.*' matches every 2.x version. Version numbers that use `+' to separate two adjacent version numbers sort correctly. The relational comparisons can be used to check if certain versions of a port are installed, which is useful for conflict checking, i.e. CONFLICTS= {,ru-}apache{,+mod_ssl}{,+ipv6}<2.* or to record dependencies on certain versions of a port. Currently it is used to check installed ports for vulnerable versions in portaudit. The patch against -CURRENT is available at http://people.freebsd.org/~eik/pkg_install-20040501.diff MD5 = 7519c2c883c59a16f96d391660d9227c SIZE = 57701 or as port sysutils/pkg_install-devel. If this port is installed with PREFIX=/usr the base tools are replaced and restored when deinstalling the port, so this is probably the most easy way to test the new version. CVS history is available at The next thing I want to do is an integration of vulnerability checking in pkg_add, probably with a plug-in mechanism for formats other than plain text. -Oliver