From owner-svn-ports-head@FreeBSD.ORG Mon Dec 23 22:26:44 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16B76558; Mon, 23 Dec 2013 22:26:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE15714DD; Mon, 23 Dec 2013 22:26:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNMQhH4074009; Mon, 23 Dec 2013 22:26:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNMQhn4074007; Mon, 23 Dec 2013 22:26:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312232226.rBNMQhn4074007@svn.freebsd.org> From: Xin LI Date: Mon, 23 Dec 2013 22:26:43 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r337303 - in head/ports-mgmt/portaudit: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 22:26:44 -0000 Author: delphij Date: Mon Dec 23 22:26:43 2013 New Revision: 337303 URL: http://svnweb.freebsd.org/changeset/ports/337303 Log: Detect pkgNG. When pkgNG is present and there is packages managed by pkgNG, give user a warning and run pkg audit -F instead. PR: ports/185147 Submitted by: ohauer Modified: head/ports-mgmt/portaudit/Makefile head/ports-mgmt/portaudit/files/portaudit-cmd.sh Modified: head/ports-mgmt/portaudit/Makefile ============================================================================== --- head/ports-mgmt/portaudit/Makefile Mon Dec 23 22:04:06 2013 (r337302) +++ head/ports-mgmt/portaudit/Makefile Mon Dec 23 22:26:43 2013 (r337303) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= portaudit -PORTVERSION= 0.6.1 +PORTVERSION= 0.6.2 CATEGORIES= ports-mgmt security DISTFILES= Modified: head/ports-mgmt/portaudit/files/portaudit-cmd.sh ============================================================================== --- head/ports-mgmt/portaudit/files/portaudit-cmd.sh Mon Dec 23 22:04:06 2013 (r337302) +++ head/ports-mgmt/portaudit/files/portaudit-cmd.sh Mon Dec 23 22:26:43 2013 (r337303) @@ -53,6 +53,10 @@ portaudit_confs() : ${portaudit_fixed=""} : ${portaudit_openssl:="/usr/bin/openssl"} + + # check if new pkg tools are in use + : ${pkgng_db:="/var/db/pkg/local.sqlite"} + : ${PKGSTATIC:="%%PREFIX%%/sbin/pkg-static"} } extract_auditfile_raw() @@ -438,6 +442,20 @@ if $opt_version; then echo "portaudit version %%PORTVERSION%%" fi +if [ -e ${pkgng_db} -a -x ${PKGSTATIC} ]; then + IPKGNG=`echo 'SELECT COUNT() FROM packages;' | $PKGSTATIC shell` + if [ ${IPKGNG} -ge 1 ]; then + echo "New pkg tools detected: found ${IPKGNG} installed packages." + echo + echo "The portaudit tool is now obsolete, please remove portaudit and use the" + echo "command 'pkg audit' instead. See man pkg-audit(8) for more information." + echo + echo "Running ${PKGSTATIC} audit -F:" + ${PKGSTATIC} audit -F + exit 1 + fi +fi + if $opt_fetch; then if $opt_quiet ; then portaudit_fetch_cmd="${portaudit_fetch_cmd} -q"