[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rpm-devel
Subject:    Re: [CVS] RPM: rpm/ VENDOR rpm/lib/ psm.c rpm/rpmdb/ rpmtag.h
From:       "Ralf S. Engelschall" <rse+rpm-devel () rpm5 ! org>
Date:       2008-01-30 21:29:38
Message-ID: 20080130212938.GA39148 () engelschall ! com
[Download RAW message or body]

On Wed, Jan 30, 2008, Ralf S. Engelschall wrote:

> [...]
> The "first install time" then could be implemented e.g. like this:
>
> %_install_tag_filter_INSTALLTIME() \
>     INSTALLTIME %1 \
>     INSTALLTIME1ST %%|INSTALLTIME1ST?{%%{INSTALLTIME1ST}}:{%1}|
>
> To allow one to create new tags from scratch, RPM additionally would
> always expand and process the filter "%{__install_tag_filter_NONE}".
> This allows e.g.:
>
> %_install_tag_filter_NONE() \
>     FOO My\ Lovely\ Custom\ Tag
>
> And because the values are macro-expanded before they are
> treated as query string one even could do crazy things like:
>
> %_install_tag_filter_FOO() \
>     FOO %{lua: print(util.rsubst(rpm.expand("%1"), "[ \t]+", "")) }
>
> Which would during installation would remove all whitespaces from the
> value of tag FOO.

There is one more possibility, but it perhaps is still not acceptable
for all people (I'm personally fine with it): One does no macro tricks
here at all. Instead during installation one simply puts all tags into
a key/value table, calls a RPM Lua function with this table, allow
this function to modify the table in arbitrary ways and then use the
key/value pairs in the resulting table. This way one does not have to
escape anything, one can delete, add and modifiy tags easily, etc. One
just need RPM Lua for this, but OTOH: those who want to do RPM tricks
need RPM Lua anyway. So this would be no major drawback. And because
RPM Lua has the rpm.query() command (although this also opens a new DB
transaction) one can do really cool tricks! I personally favor this
approach...
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        rpm-devel@rpm5.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic