From owner-svn-ports-all@FreeBSD.ORG Thu Jun 27 03:47:00 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 508F1F94; Thu, 27 Jun 2013 03:47:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27A7D1302; Thu, 27 Jun 2013 03:47:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5R3l074080959; Thu, 27 Jun 2013 03:47:00 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5R3kxdk080956; Thu, 27 Jun 2013 03:46:59 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201306270346.r5R3kxdk080956@svn.freebsd.org> From: Bryan Drewery Date: Thu, 27 Jun 2013 03:46:59 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r321846 - in head/ports-mgmt/pkg: . 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-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 27 Jun 2013 03:47:00 -0000 Author: bdrewery Date: Thu Jun 27 03:46:59 2013 New Revision: 321846 URL: http://svnweb.freebsd.org/changeset/ports/321846 Log: - Fix 'pkg query %a' returning true/false instead of 0/1. This was showing as a warning in portmaster/portupgrade and could have caused packages to be registered incorrectly automatic/non-automatic on upgrade. Reported by: many Obtained from: upstream git Added: head/ports-mgmt/pkg/files/ head/ports-mgmt/pkg/files/patch-pkg__query.c (contents, props changed) Modified: head/ports-mgmt/pkg/Makefile Modified: head/ports-mgmt/pkg/Makefile ============================================================================== --- head/ports-mgmt/pkg/Makefile Thu Jun 27 03:27:59 2013 (r321845) +++ head/ports-mgmt/pkg/Makefile Thu Jun 27 03:46:59 2013 (r321846) @@ -2,6 +2,7 @@ PORTNAME= pkg DISTVERSION= 1.1.2 +PORTREVISION= 1 CATEGORIES= ports-mgmt MASTER_SITES= http://files.etoilebsd.net/pkg/ \ http://mirror.shatow.net/freebsd/${PORTNAME}/ \ Added: head/ports-mgmt/pkg/files/patch-pkg__query.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg/files/patch-pkg__query.c Thu Jun 27 03:46:59 2013 (r321846) @@ -0,0 +1,42 @@ +From f127fb779a1a405446804235fce223cc8abc44ea Mon Sep 17 00:00:00 2001 +From: Bryan Drewery +Date: Wed, 26 Jun 2013 06:48:17 -0500 +Subject: [PATCH] Revert pkg-query %a and %k back to an integer + +Scripts such as portmaster and portupgrade expect an integer +here. This is also the advertised result in the manpage. +--- + pkg/query.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/pkg/query.c b/pkg/query.c +index bdca068..5cb00e0 100644 +--- pkg/query.c ++++ pkg/query.c +@@ -77,6 +77,8 @@ + static void + format_str(struct pkg *pkg, struct sbuf *dest, const char *qstr, void *data) + { ++ bool automatic; ++ bool locked; + + sbuf_clear(dest); + +@@ -109,10 +111,12 @@ + pkg_sbuf_printf(dest, "%w", pkg); + break; + case 'a': +- pkg_sbuf_printf(dest, "%a", pkg); ++ pkg_get(pkg, PKG_AUTOMATIC, &automatic); ++ sbuf_printf(dest, "%d", automatic); + break; + case 'k': +- pkg_sbuf_printf(dest, "%k", pkg); ++ pkg_get(pkg, PKG_LOCKED, &locked); ++ sbuf_printf(dest, "%d", locked); + break; + case 't': + pkg_sbuf_printf(dest, "%t", pkg); +-- +1.8.1.6 +