RPM Community Forums

Mailing List Message of <rpm-users>

Re: rpm-5.0.2: changing package file name convention

From: Ralf S. Engelschall <rse+rpm-users@rpm5.org>
Date: Wed 06 Feb 2008 - 19:28:34 CET
Message-ID: <20080206182834.GA74564@engelschall.com>
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):

#   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)) \

                                       Ralf S. Engelschall
Received on Wed Feb 6 19:30:48 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.