diff options
author | Bryan Drewery <bdrewery@FreeBSD.org> | 2013-06-27 03:46:59 +0000 |
---|---|---|
committer | Bryan Drewery <bdrewery@FreeBSD.org> | 2013-06-27 03:46:59 +0000 |
commit | ea1e0ca9756219cbe74c39c01b42e2245b70988f (patch) | |
tree | c6348341d4916363c1add5872afa5af2fbc966f0 /ports-mgmt | |
parent | 46f98b2367f6f2b298283fd4fa356daccaa86245 (diff) | |
download | ports-ea1e0ca9756219cbe74c39c01b42e2245b70988f.tar.gz ports-ea1e0ca9756219cbe74c39c01b42e2245b70988f.zip |
- 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
Notes
Notes:
svn path=/head/; revision=321846
Diffstat (limited to 'ports-mgmt')
-rw-r--r-- | ports-mgmt/pkg/Makefile | 1 | ||||
-rw-r--r-- | ports-mgmt/pkg/files/patch-pkg__query.c | 42 |
2 files changed, 43 insertions, 0 deletions
diff --git a/ports-mgmt/pkg/Makefile b/ports-mgmt/pkg/Makefile index fdccaf8306b7..8ad7a327a47f 100644 --- a/ports-mgmt/pkg/Makefile +++ b/ports-mgmt/pkg/Makefile @@ -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}/ \ diff --git a/ports-mgmt/pkg/files/patch-pkg__query.c b/ports-mgmt/pkg/files/patch-pkg__query.c new file mode 100644 index 000000000000..f0639c6094d4 --- /dev/null +++ b/ports-mgmt/pkg/files/patch-pkg__query.c @@ -0,0 +1,42 @@ +From f127fb779a1a405446804235fce223cc8abc44ea Mon Sep 17 00:00:00 2001 +From: Bryan Drewery <bryan@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 + |