RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Extending header extension tag syntax.

From: Jeff Johnson <n3npq@mac.com>
Date: Tue 13 May 2008 - 00:18:23 CEST
Message-Id: <C0C5D2FA-DB30-42FF-BAB5-E35AEE572406@mac.com>

On May 12, 2008, at 3:25 AM, Ralf S. Engelschall wrote:

> On Sun, May 11, 2008, Jeff Johnson wrote:
>
>> [...]
>>    Is a --queryformat pipeline a pipeline of extractors or  
>> transformers?
>
> Pipeline of transformers is usually more flexible, I think. But  
> both can
> be useful to have. I personally would prefer to have the pipeline of
> transformers but pipeline of extractors might be usually also  
> sufficient
> for most scenarios.
>

I achieved what I set out to do (note ':' vs '|' separator in the 2nd  
& 3rd examples)

[jbj@wellfleet wdj]$ rpm -q --qf '%{PACKAGESTAT|stat(mode,size)}\n' time
100644 | 25336
[jbj@wellfleet wdj]$ rpm -q --qf '%{PACKAGESTAT|stat(mode):stat(size)} 
\n' time
100644 | 25336
[jbj@wellfleet wdj]$ rpm -q --qf '%{PACKAGESTAT|stat(mode)|stat(size)} 
\n' time
100644 | (Lstat:100644:No such file or directory)


In short ":foo" == an extractor, and (just like shell) "|bar" == a  
transformer,
the difference being whether the currently accumulating output string is
saved before calling the formmatter (or not).

More than a bit alien & subtle imho, I'll likely hate the hackery  
tomorrow, but will do for now,
and for coding up pattern/lua formatters in the pipeline.

I'm likely headed for a string representation of a tuple as
     { a,b,c }
but that's just guess. I won't know where I'm going until I get there.

Truly, I'm the last person in the world you want writing parsers ;-)

Escaping and permitting white space are surely gonna be a pita too,
the --queryformat argument string has always been uber geeky ...

73 de Jeff
Received on Tue May 13 00:19:46 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.