RPM Community Forums

Mailing List Message of <rpm-users>

Re: rpm-5.0.2: changing package file name convention

From: Jeff Johnson <n3npq@mac.com>
Date: Wed 06 Feb 2008 - 19:51:26 CET
Message-Id: <79EEC931-E6B6-41E0-992F-BBA6F83622AD@mac.com>

On Feb 6, 2008, at 1:28 PM, Ralf S. Engelschall wrote:

> On Wed, Feb 06, 2008, Jeff Johnson wrote:
>> On Feb 6, 2008, at 11:59 AM, Stefan Westmeier wrote:
>> [...]
>> Nothing you can do, but it would not be hard to
>> add a macro to differentiate the internal from the
>> external name of a "package" when displaying.
>> Lemme noodle a bit this week ... differentiating
>> internal names from display names likely needs
>> to happen for i18n (and encoding) reasons.
>> [...]
> As for OpenPKG I already had to patch RPM to get rid of the "A" part
> of "NEVRA" (just "A" is too weak for OpenPKG and hence it is better
> to not display it at all in any outputs), I would like to go one step
> further: all places where RPM currently outputs the NEVRAs tuple
> <N,E,V,R,A> as the plain text "N-V-R.A" should be made more flexible
> and actually output via a macro expansion like "%{?__display_nevra N E
> V R A}%{!?__display_nevra N-V-R.A}". This way Stefan's request and my
> requests can be solved like this (except that the use of rpm.query()
> might be a performance problem):

Yep. There are further issues with rpmbuild error messages attaching
misleading ".pubkey" as arch etc etc etc, and see also several segfaults
during rpm-5.0 release cycle having to do with mucking about with
RPMTAG_ARCH for non-binary rpm Headers.

> #   Stefan:
> %__display_nevra() %{lua: \
>     local N, E, V, R, A = unpack(util.rsplit(rpm.expand("%*"), "\\s 
> +")) \
>     local P, B = unpack(util.rsplit(rpm.query("%{Project} % 
> {Branch}"), "\\s+")) \
>     print(string.format("%s-%s-%s-%s.%s", N, V, P, B, R, A)) \
> }
> #   Ralf:
> %__display_nevra() %{lua: \
>     local N, E, V, R, A = unpack(util.rsplit(rpm.expand("%*"), "\\s 
> +")) \
>     print(string.format("%s-%s-%s", N, V, R)) \
> }

The problem with using %{lua:...} is that it is too dynamic to create
an rpmdb index with: I have no clue what %* actually contains in
your examples.

So I'm likely to attach a headerSprintf() query format to the  
header extension tag, and then use RPMTAG_NVRA as the default
display format everywhere a "package" needs to be identified.

The only flaw that I currently see is that --rebuilddb to regenerate  
the Nvra index
will be needed whenever
	%_display_nvra	%%{name}-%%{version}-%%{release}.%%{arch}}
headerSprintf() queryformat changes in configuration. That problem  
can be lived
with until I get a timestamp to compare configuration changes against  
index creation for lazy table rebuilding.

73 de Jeff
>                                        Ralf S. Engelschall
>                                        rse@engelschall.com
>                                        www.engelschall.com
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> User Communication List                             rpm-users@rpm5.org
Received on Wed Feb 6 19:51:59 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.