As you have certainly recognized on this list, I've recently developed
a larger set features for RPM 5 with the help of RPM's integrated Lua.
Although I'm still far away from ever being a Lua-fan (see also my BLOG
under http://trainofthoughts.org/blog/2007/09/16/lua-popularity/), I
have to admit that the availability of Lua in RPM is some sort of a
killer-feature -- most people certainly just will not recognize.

But already the "%{lua: ....}" macro functionality is the ultimative
escape to implement really sophisticated RPM macro hacks. Well, ok, I
first had to extend the Lua "rpm.*" namespace with additional functions
and also implement a bunch of reusable functions in Lua itself under the
"util.*" namespace, but now it is really a powerful and useful tool.

Initially I was very sceptic and wanted to avoid Lua in RPM, but
once I recognized that this way I was finally able to implement some
long-awaited essential RPM features for OpenPKG, I have to admit that
IMHO Lua really is a great benefit for RPM. Ok, actually every embedded
scripting language would be as beneficial as Lua here, of course. But
RPM only has Lua support, so the hero is Lua.

In other words, let me just share my experience: if you want to power
up your RPM 5, you really have to get used to Lua and the "%{lua: ...}"
functionality! It opens you a large window to new possibilities.

One final tip: when developing in RPM Lua, do not forget that you
have my handy util.dump() function at hand for dumping and debugging
arbitrary complex Lua data structures (in Lua syntax). Also, I strongly
recommend you to build RPM 5 with --with-lua --with-pcre in order to get
PCRE support in my implemented util.r{match,subst,split}() functions.
Believe me, you don't want to hack RPM in Lua without these tools... ;-)

                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com

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

Reply via email to