RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/ CHANGES rpm/build/ files.c

From: Jeff Johnson <n3npq@mac.com>
Date: Sat 05 Jul 2008 - 03:48:19 CEST
Message-id: <3EEC6544-D239-481B-84C5-66DAD9EA394A@mac.com>
Glad to see someone new hacking ;-)

Meanwhile ...

On Jul 4, 2008, at 9:24 PM, Alexey Tourbin wrote:
>
>   +	    if (!N1) headerNEVRA(h1, &N1, NULL, NULL, NULL, NULL);
>   +	    if (!N2) headerNEVRA(h2, &N2, NULL, NULL, NULL, NULL);
>   +	    rpmlog(RPMLOG_WARNING,
>   +		   _("file %s is packaged into both %s and %s\n"),
>   +		   fn1, N1, N2);
>

This paradigm of displaying N-V-R.A (or whatever is deemed informative)
is an obviously (duh!) widely repeated paradigm throughout rpm.

These days, there is
     RPMTAG_NVRA
as a header extenison through a macro to a configurable --queryformat
that should be used instead. That has a prayer of generalizing to  
various
needs.

Some variant of

     he->tag = RPMTAG_NVRA;
     N1 = (headerGet(h1, he, 0) ? he->p.str : NULL);
     he->tag = RPMTAG_NVRA;
     N2 = (headerGet(h2, he, 0) ? he->p.str : NULL);
     ...
     N1 = _free(N1);
     N2 = _free(N2);

is likely what I would do.

Note that all memory returned by headerGet() needs to be freed,
a change in rpm-5.0 from previous.

BTW, don't waste time fiddling splint annotations unless you really  
want to.
I don't expect anyone to bother, and its easier for me to just make a  
pass
and fix the slow decay than it is to explain what to do ...

73 de Jeff
Received on Sat Jul 5 03:48:30 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.