[Rpm-maint] Re: %post-script prerequisites

Pixel pixel at mandriva.com
Thu Sep 25 12:37:27 UTC 2008

Michael Schroeder <mls at suse.de> writes:

> So A requires B and B has a requires(post) to A? This isn't installable
> at all, thus it's a packaging bug.

i don't agree.

not knowing exactly what rpmlib does, here is how i understand the pb:

"Requires" is same as "Requires(postrans)", ie if A requires B, it
doesn't mean B must be installed before A.

(1) the typical example:
  B requires A
  C requires(post) B
becomes after graph closure
  C requires(post) B
  C requires(post) A
  C requires(post) B requires A
  C requires(post) A
(the strongest require is kept [*])

(2) Alexey's example:
  A requires(post) B
  B requires A
  A requires(post) B
  A requires(post) A

"A requires(post) A", is it a tautology? i would say yes,
whereas "A requires(pre) A" is always false. Otherwise, what's the use
having a distinction between pre and post!

"A requires(pre) B"  means "install B files before doing A %pre"
"A requires(post) B" means "install B files before doing A %post"

so example (1) says "install C after A and B"
   example (2) says "install A after B"

(3) another example
  A requires(post) B
  B requires(post) A
is the same after closure, and so says "install A after B" and
"install B after A", which is not possible, and must be an error
(rpm correctly makes an "rpmtsOrder failed" error)

(4) Alexey's example with pre
  A requires(pre) B
  B requires A
  A requires(pre) B
  A requires(pre) A
which is impossible and must be an error 
(rpm currently accepts this and install B first)


[*] ordering used: pre > post > posttrans.
    so for example "A requires(post) B requires (pre) C requires D"
    becomes "A requires(pre) D"

nb: erasure can be handled quite the same

More information about the Rpm-maint mailing list