From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 13 Apr 2020 21:20:21 +0300 From: "Vladimir D. Seleznev" To: ALT Linux Team development discussions Message-ID: <20200413182021.GA15437@portlab> References: <20200411134655.da40352c20a0e0bde65a474d@altlinux.org> <20200412030226.1886291-1-vseleznv@altlinux.org> <20200413180437.GC21630@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200413180437.GC21630@altlinux.org> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [devel] [PATCH] Verbose QueryTags prints whether tag is an extension X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2020 18:20:22 -0000 Archived-At: List-Archive: List-Post: On Mon, Apr 13, 2020 at 09:04:37PM +0300, Dmitry V. Levin wrote: > On Sun, Apr 12, 2020 at 06:02:26AM +0300, Vladimir D. Seleznev wrote: > > Verbose QueryTags prints four field: tagname, tagvalue, tagtype and whether > > it is an extension. To make it possible QueryTags uses new function > > rpmTagIsExtension() that returns 0 if tag is real, 1 if tag is an extension > > or -1 if tag is not found. > > > > * lib/query.c(rpmDisplayQueryTags): Print whether tag is an extension. > > * lib/rpmtag.h(rpmTagIsExtension): New definition. > > * lib/tagname.c(rpmTagIsExtension): New function. > > --- > > lib/query.c | 5 +++++ > > lib/rpmtag.h | 7 +++++++ > > lib/tagname.c | 14 ++++++++++++++ > > 3 files changed, 26 insertions(+) > > > > diff --git a/lib/query.c b/lib/query.c > > index 60d3a0269..f27b15a7c 100644 > > --- a/lib/query.c > > +++ b/lib/query.c > > @@ -253,9 +253,14 @@ void rpmDisplayQueryTags(FILE * fp) > > if (rpmIsVerbose()) { > > rpmTagVal tag = rpmTagGetValue(sname); > > rpmTagType type = rpmTagGetTagType(tag); > > + int ext = rpmTagIsExtension(tag); > > fprintf(fp, "%-20s %6d", sname, tag); > > if (type > RPM_NULL_TYPE && type <= RPM_MAX_TYPE) > > fprintf(fp, " %s", tagTypeNames[type]); > > + else if (ext == 1) > > + fprintf(fp, " -"); > > + if (ext == 1) > > + fprintf(fp, " ext"); > > } else { > > fprintf(fp, "%s", sname); > > } > > This changes rpmDisplayQueryTags output in an incompatible way. rpm --verbose --querytags is missing in rpm 4.0.4, and is undocumented feature of modern rpm. Should we care about compatibility in this particular case? -- WBR, Vladimir D. Seleznev