On Jan 2, 2011, at 12:21 PM, Silvan Calarco wrote:

> On Thursday 30 December 2010 16:58:43 Jeff Johnson wrote:
>> Two asides:
>> 
>> 1) I have the start of a functionally equivalent replacement for
>> genpkglist/gensrcpkglist written in C. I can finish writing those
>> two tools (in C using POPT) with c couple of days of work if there's
>> interest. My interest at the time was studying what Debian uses
>> for repository markup as well as fro POPT development (I also maintain
>> POPT).
> 
> I have a plan to include genpkglist/gensrcpkglist in the openmamba tool 
> distromatic because it would be natural as it is done to generate all 
> repository output files needed. It has already all repository data structures 
> in memory, so just the output code needs to be ported.
> BTW with the attached patch I workarounded the build and segfault with apt-
> repo-tools. The segfault was around some LUA code in the rpmReadConfigFiles() 
> call, which by evidence I don't need.
> 

If you want, I'll carry genpkglist/gensrcpkglist in tools/* @rpm5.org.

The rationale for integrating into RPM sources is easy maintenance of
the RPM bottom-side API. OTOH, if the output "spewage" markup is changing
actively, then integrating @rpm5.org just creates Yet Another Maintenance Task.

I can go either way @rpm5.org dependent on circumstances. But having 
python/perl/ruby/js
in tree permits rapid detection/porting of any changes (usually deep, not 
API/ABI
related) in RPM code.

>> 2) RPM has something called "queryformat templates" in /usr/lib/rpm/qf/*
>> that can be used to generate markup based on package metadata.
> 
> Interesting.
> I don't know if a template could be used to do this, but we have patched rpm 
> (patch attached), to have a function that produces a "preprocessed" specfile:
> 
> rpm -q --specedit --specfile gcc.spec --define="inputvar inputvalue"
> 

Hmmm ,,, --specedit needs to DIE! DIE! DIE! someday.

The replacement is (for full macro expansion)
        rpm -D 'inputvar inputvalue' -E "`cat gcc.spec`"
or (for single tag NVRA query, i.e. the default if no --qf was used)
        rpm -D 'inputvar inputvalue' --qf '%{___NVRA}\n' --specfile gcc.spec
Note that there's both --specsrpm and --specfile, the first queries only the 
SRPM header.

> This is not a good upstream patch, it changes the meaning of an existing 
> undocumented option, but we did it to quickly fix our automatic update 
> processes which where weak in specfile variable resolution. Maybe this can be 
> done in other ways or this might just be a feature request :) (BTW we are 
> currently fine with our patch).
> 

Thanks for the patch. I'll try to integrate (for rpm-5.4.1, backports to 
rpm-5.3.x/rpm-5.2.x
are possible) in the next day or two.

hth

73 de Jeff

> Silvan
> 
> -- 
> mambaSoft di Calarco Silvan
> Web: http://www.mambasoft.it
> 
> mambaSoft Store @ http://www.mambastore.it
> openmamba GNU/Linux development @ http://www.openmamba.org
> <apt-repo-tools-0.6.0.12-rpm-5.patch><rpm-5.2.1-spec_preprocessed_output.patch>

______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        [email protected]

Reply via email to