From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jul 24 20:00:36 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 873701065676 for ; Tue, 24 Jul 2012 20:00:36 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F2C938FC17 for ; Tue, 24 Jul 2012 20:00:26 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6OK0Q9X067906 for ; Tue, 24 Jul 2012 20:00:26 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6OK0QaI067905; Tue, 24 Jul 2012 20:00:26 GMT (envelope-from gnats) Resent-Date: Tue, 24 Jul 2012 20:00:26 GMT Resent-Message-Id: <201207242000.q6OK0QaI067905@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "A.J. Kehoe IV (Nanoman)" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 222DC106566B for ; Tue, 24 Jul 2012 19:57:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 0BDBC8FC16 for ; Tue, 24 Jul 2012 19:57:27 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6OJvQKu040814 for ; Tue, 24 Jul 2012 19:57:26 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q6OJvQEe040813; Tue, 24 Jul 2012 19:57:26 GMT (envelope-from nobody) Message-Id: <201207241957.q6OJvQEe040813@red.freebsd.org> Date: Tue, 24 Jul 2012 19:57:26 GMT From: "A.J. Kehoe IV (Nanoman)" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/170118: [patch] Add pkgng Support to sysutils/bsdstats X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 20:00:36 -0000 >Number: 170118 >Category: ports >Synopsis: [patch] Add pkgng Support to sysutils/bsdstats >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Tue Jul 24 20:00:26 UTC 2012 >Closed-Date: >Last-Modified: >Originator: A.J. Kehoe IV (Nanoman) >Release: 9.0 >Organization: Nanoman's Company >Environment: FreeBSD localhost 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:15:25 UTC 2012 root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: The FreeBSD port sysutils/bsdstats supports pkg_* tools, but does not support pkgng. pkgng will soon become the default package management system in FreeBSD, whereas pkg_* tools will soon become unsupported. Thank you to Anton Shterenlikht for reporting this problem. >How-To-Repeat: >Fix: I've attached a patch for the port's files/300.statistics.in file. The patch adds support for pkgng while preserving support for pkg_* tools. The patch also includes instructions for removing pkg_* tools support when it's officially discontinued. Patch attached with submission follows: --- ports/sysutils/bsdstats/files/300.statistics.in.old 2011-09-25 17:35:26.000000000 -0400 +++ ports/sysutils/bsdstats/files/300.statistics.in 2012-07-24 15:51:16.841357000 -0400 @@ -100,13 +100,63 @@ 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 ;; >Release-Note: >Audit-Trail: >Unformatted: