[Yum-devel] remove dependency ordering problem

Jesse Keating jkeating at j2solutions.net
Wed Apr 2 11:56:42 UTC 2008

On Tue, 2008-04-01 at 14:59 -0600, Robert Mecklenburg wrote:
> On Tue, 2008-04-01 at 15:39 -0400, Jesse Keating wrote:
> > Are you making proper use of Requires(post): ?
> Good question.  Here is the relevant portion of one of our spec files:
>     ...
>     Group: Applications
>     Requires: s5base
>     Requires: s5corelibs
>     %pre
>     ...
> This is generated by epm and seems to work correctly to install our
> packages from a yum repository.  I have not been able to find
> documentation on your "(post)" syntax, however.  Could explain what it
> does?

Ok, there is a difference between "I require this other package so that
I can run" and "I require this other package so that my %pre or my %post
can make use of it (or %preun/%postun)".  Quick brief on rpm:

You say Foo requires Bar and Baz, and your transaction set lists 'foo
bar baz'.  Rpm can pick any order it wants to for installing foo bar and
baz, so long as they all get installed in the same transaction set.
That's mostly what you're seeing on install.  Removal is the same, so
long as foo bar and baz are removed in the same transaction set rpm
could care less about the ordering.

It sounds to me like you need to make use of say foo, in the %preun part
of baz, that is before you remove baz, use foo to do some cleanup.  To
express that to rpm, you need to have a Requires(preun): foo in your baz
spec.  That means "I need to use foo in the %preun part of baz".  This
will give rpm the hint that when removing foo bar and baz, make sure (if
possible) that foo is removed /after/ baz.

Without giving rpm the information of what you actually require in your
scriptlets it can't know what the "correct" install/removal order is.

> > If I understand it correctly, removal ordering and install ordering is
> > all inside rpm itself, not yum.  Yum just hands rpm a transaction list,
> > rpm figures out what order to do it in.  
> Hmmm, the version of rpm we are using does not appear to handle
> dependencies during erase correctly.  That is, when I run rpm with an
> explicit list of all the packages to remove, rpm will not order the
> erasures properly -- even though the Requires: lines are correct and
> work during install.

That's just plain wrong.  Plain Requires don't really matter to
install/remove ordering, they just signal that the things Required have
to either install or be removed in the same transaction set or later.
Ordering is not a concern.

> > You have to give rpm hints if you need things for %pre and %post so
> > that it can get the ordering correct.
> I'd love to if you can tell me how?  I was under the impression that
> Requires: was the way to do that.  The "%pre" and "%post" are used to
> specify scripts for pre- and post- installation, which is not
> relevant, or am I wrong?

Read above.

Jesse Keating RHCE      (jkeating.livejournal.com)
Fedora Project          (fedoraproject.org/wiki/JesseKeating)
GPG Public Key          (geek.j2solutions.net/jkeating.j2solutions.pub)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20080402/7ed328d6/attachment.pgp 

More information about the Yum-devel mailing list