summaryrefslogtreecommitdiff
path: root/lib/headerfmt.c
diff options
context:
space:
mode:
authorFlorian Festi <ffesti@redhat.com>2016-11-23 09:04:09 +0100
committerFlorian Festi <ffesti@redhat.com>2016-11-23 09:27:53 +0100
commit7f47cbbd7d1600ae280e48a655c9e870cf9361e0 (patch)
tree78bcf6caccd8b977e5973fffc56c1b2851984da2 /lib/headerfmt.c
parent64096c2626e2973bda60c303a14e7dcfa5b85718 (diff)
downloadrpm-7f47cbbd7d1600ae280e48a655c9e870cf9361e0.tar.gz
Restore 4.12 behaviour of --qf wrt single value tags in [ ] loops
This was changed with b722cf86200505b3e3fcbb2095c4ff61f1f5a2ab e.g. rpm -q --qf '[%{PROVIDENAME}\t%{NAME}\n]' zlib changed from libz.so.1()(64bit) zlib libz.so.1(ZLIB_1.2.0)(64bit) zlib libz.so.1(ZLIB_1.2.0.2)(64bit) zlib ... to libz.so.1()(64bit) zlib libz.so.1(ZLIB_1.2.0)(64bit) (none) libz.so.1(ZLIB_1.2.0.2)(64bit) (none) ... This patch adds an implicit "=" by setting tag.justOne for non array tags in such loops to get back the previous output.
Diffstat (limited to 'lib/headerfmt.c')
-rw-r--r--lib/headerfmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/headerfmt.c b/lib/headerfmt.c
index 951dbc851..2bb597fcc 100644
--- a/lib/headerfmt.c
+++ b/lib/headerfmt.c
@@ -414,6 +414,12 @@ static int parseFormat(headerSprintfArgs hsa, char * str,
goto errxit;
}
+ /* Set justOne = 1 for non ARRAY tags */
+ if (!(rpmTagGetReturnType(token->u.tag.tag) &
+ RPM_ARRAY_RETURN_TYPE)) {
+ token->u.tag.justOne = 1;
+ }
+
start = next;
break;