RPM Community Forums

Mailing List Message of <rpm-devel>

Re: %post-script prerequisites

From: Alexey Tourbin <at@altlinux.ru>
Date: Wed 24 Sep 2008 - 18:42:17 CEST
Message-ID: <20080924164216.GM839@altlinux.org>
On Wed, Sep 24, 2008 at 12:26:10PM -0400, Jeff Johnson wrote:
> You do know that bash --rpm-requires will extract
> dependencies for all scriptlets, not just %post and %preun,
> automagically for several years now?

Think about this again: package foo has program /usr/bin/update-foo,
which is invoked in %post-script of the package.  The program is linked
with e.g. libglib-2.0.so.0(GLIB_2.18), and we have the dependency
"Requires: libglib-2.0.so.0(GLIB_2.18)".  However, this is merely
"Requires".  To run /usr/bin/update-foo in the %post script reliably,
that must be "Requires(post)".  Or otherwise there's a possibility that,
despite topological reordering, glib2 gets installed or upgraded after
foo, and so the %post scriptlet fails miserably.

So, there's a general problem: if you both package a program and run
it in the %post-script (in the very same package), then bare Requires
are not enough: some of them (namely, which are used by the program)
should also become Requires(post).

  • application/pgp-signature attachment: stored
Received on Wed Sep 24 18:42:17 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.