From owner-svn-ports-all@FreeBSD.ORG Sat Jul 28 12:27:29 2012 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A271065674; Sat, 28 Jul 2012 12:27:29 +0000 (UTC) (envelope-from scheidell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4D448FC08; Sat, 28 Jul 2012 12:27:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6SCRSGG025654; Sat, 28 Jul 2012 12:27:28 GMT (envelope-from scheidell@svn.freebsd.org) Received: (from scheidell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SCRSCB025651; Sat, 28 Jul 2012 12:27:28 GMT (envelope-from scheidell@svn.freebsd.org) Message-Id: <201207281227.q6SCRSCB025651@svn.freebsd.org> From: Michael Scheidell Date: Sat, 28 Jul 2012 12:27:28 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r301654 - in head/sysutils/bsdstats: . files X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 12:27:29 -0000 Author: scheidell Date: Sat Jul 28 12:27:28 2012 New Revision: 301654 URL: http://svn.freebsd.org/changeset/ports/301654 Log: - Add pkgng support PR: ports/170118 Submitted by: bsdstats@nanoman.ca (maintainer) Modified: head/sysutils/bsdstats/files/300.statistics.in head/sysutils/bsdstats/pkg-install Modified: head/sysutils/bsdstats/files/300.statistics.in ============================================================================== --- head/sysutils/bsdstats/files/300.statistics.in Sat Jul 28 12:21:10 2012 (r301653) +++ head/sysutils/bsdstats/files/300.statistics.in Sat Jul 28 12:27:28 2012 (r301654) @@ -100,13 +100,63 @@ send_devices () { send_ports () { case $(uname) in FreeBSD ) - for line in `/usr/sbin/pkg_info | /usr/bin/awk '{print $1}' ` - do - category=`grep "@comment ORIGIN" /var/db/pkg/${line}/+CONTENTS | sed -E 's/^\@comment ORIGIN:(.+)\/.+/\1/g'` - line=$(uri_escape $line) - category=$(uri_escape $category) - query_string=$query_string`echo \&port[]=${category}:${line}` - done + + ############################################################################ + # At the time of this writing (2012-07-24), FreeBSD is switching from + # pkg_* tools to pkgng. Starting in FreeBSD 9.1, pkgng will become the + # default tool for package management. + # + # Until pkg_* tools are officially declared unsupported, they will need + # legacy support in ports like this one. When the need for this support is + # officially discontinued, please do the following: + # + # 1. Delete the contents of this "LEGACY" section: + # + #-----BEGIN LEGACY----- + # Detect pkgng + if [ -e /var/db/pkg/local.sqlite ]; then + + # Use pkgng + + for line in `pkg info | awk '{ print $1 }'` + do + category=`pkg info -q -o ${line} | sed 's/\/.*//g'` + line=$(uri_escape $line) + category=$(uri_escape $category) + query_string=$query_string`echo \&port[]=${category}:${line}` + done + + else + + # Use pkg_* tools + + for line in `pkg_info | awk '{ print $1 }'` + do + category=`grep "@comment ORIGIN" /var/db/pkg/${line}/+CONTENTS | sed -E 's/^\@comment ORIGIN:(.+)\/.+/\1/g'` + line=$(uri_escape $line) + category=$(uri_escape $category) + query_string=$query_string`echo \&port[]=${category}:${line}` + done + + fi + #-----END LEGACY----- + # + # 2. Uncomment the contents of this "PKGNG" section: + # + #-----BEGIN PKGNG----- +# for line in `pkg info | awk '{ print $1 }'` +# do +# category=`pkg info -q -o ${line} | sed 's/\/.*//g'` +# line=$(uri_escape $line) +# category=$(uri_escape $category) +# query_string=$query_string`echo \&port[]=${category}:${line}` +# done + #-----END PKGNG----- + # + # 3. Delete these comments. + # + # Thank you! + ############################################################################ report_ports ;; Modified: head/sysutils/bsdstats/pkg-install ============================================================================== --- head/sysutils/bsdstats/pkg-install Sat Jul 28 12:21:10 2012 (r301653) +++ head/sysutils/bsdstats/pkg-install Sat Jul 28 12:27:28 2012 (r301654) @@ -85,4 +85,3 @@ if [ "$2" = "POST-INSTALL" ]; then fi fi fi -