RPM Community Forums

Mailing List Message of <rpm-devel>

Re: %post-script prerequisites

From: Alexey Tourbin <at@altlinux.ru>
Date: Wed 24 Sep 2008 - 21:27:15 CEST
Message-ID: <20080924192715.GP839@altlinux.org>
On Wed, Sep 24, 2008 at 07:08:54PM +0000, Alexey Tourbin wrote:
> In package foo, program /usr/bin/foo is both packaged *and* called
> in its %post script.  The program /usr/bin/foo runs /usr/bin/bar,
> for which we have the dependency "Requires: /usr/bin/bar".

Here is similar example that does not require --noorder option
to demonstrate the problem.  The difference is that packages A
and B have circular dependencies, so, unless we have "Requires(post)",
rpm choose to install A first, and its %post script fails.

Name: A
Version: 1.0
Release: 1
Summary: A
License: GPL
Group: Development/Other
Requires: /usr/bin/B
#Requires(post): /usr/bin/B
BuildArch: noarch
AutoReqProv: no
%package -n B
Summary: B
Group: Development/Other
Requires: A
AutoReqProv: no
%description -n B
mkdir -p %buildroot/usr/bin
cat >%buildroot/usr/bin/A <<EOF
cat >%buildroot/usr/bin/B <<EOF
chmod +x %buildroot/usr/bin/*
%files -n B

Now, if you uncomment "#Requires(post): /usr/bin/B", B gets installed
first.  This is the whole point: running a program in its own %post
script requires additional ordering.

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