RPM Community Forums

Mailing List Message of <rpm-users>

Re: Glibc %post

From: Jeff Johnson <n3npq@mac.com>
Date: Mon 10 May 2010 - 00:46:15 CEST
Message-id: <D3ED02E0-FB9B-42C1-8E9A-462A408D9C8A@mac.com>

On May 9, 2010, at 6:34 PM, Eric MSP Veith wrote:

> Uh, that's cool. So I could use Lua to, for example, expand variables in a 
> %{SOURCE} file? For example, %{_sbindir} in an init script or putting some 
> "%define _my_foo 42" in the spec file and having it properly expanded in 
> %{SOURCE4711}?

Well you _REALLY_ don't want to do any of that "stuff" while
upgrading glibc reliably: do your dirty and move on, this _IS_
the innermost circle of the dependency inferno.


Macros are expanded in scriptlet bodies if you use, say" %%{_sbindir}"
within the lua scriptlet body, and one can also bury the
into a macro expansion like
	%post -p %%{_glibc_post_upgrade}.%%{_target_arch}

Note the doubled "%%" escaping.

I very much advise _NOT_ doing install expansions unless you are prepared
to _GUARANTEE_ that rpm maco configuration is reliable. But the mechanism for expanding
macros on the install, not build, system has been in place for years.

Consider how depsolvers should handle

	Requires: %%{foo} >= %%{bar}

That expansion too should "work" even if utterly useless to existing
(non-rpm) depsolvers like yum.


73 de Jeff
Received on Mon May 10 00:46:53 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.