svn commit: r321846 - in head/ports-mgmt/pkg: . files
Bryan Drewery
bdrewery at FreeBSD.org
Thu Jun 27 03:47:00 UTC 2013
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 <bryan at shatow.net>
+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
+
More information about the svn-ports-head
mailing list