[Rpm-maint] [Patch 3/19] Enable PREREQ

Michael Schroeder mls at suse.de
Fri Feb 9 13:22:12 UTC 2007


On Fri, Feb 09, 2007 at 08:11:48AM -0500, Peter Bowen wrote:
> PreReq is a hint that can be used to get better package ordering when
> you are left with little else.  For example:
> 
> Package A requires B and C
> Package B requires A
> Package C requires nothing new
> None are installed on the system
> User request: Install A, B, and C.
> 
> with just this information, we know they all have to be installed at the
> end of the transaction. We know that C will be the first package
> installed, and that all will exist at the end of the transaction.  How
> do you decide if you install in the order C, A, B or C, B, A?
> 
> Each require line can have hints associated to help solve this issue.
> If you are really lucky, you will have per-scriptlet hints to tell you
> if the dependency is needed for %post, but a second best choice is the
> generic "PreReq".  This is what people have used for years to indicate
> that A needs B to exist before it can be installed, usually so one can
> run a scriptlet that uses B.

Actually you gave a bad example, if A PreReqs B and B Reqs A the
packaging order is undefined.

"A PreReqs B" means that B must *work* if A is installed.
"B Reqs A" means that A must be installed to make B work.
Thus A needs an installed A for installation -> unsolvable.

So it is also an error if there is a dependency cycle and one
of the reqs is a PreReq. Thus "PreReqs" are actually not needed
and it is sufficient to just look at the Requires.

Where PreReqs really help is to *detect* that there a unsolvable
cycle in the Packages.

Cheers,
  Michael.

-- 
Michael Schroeder                                   mls at suse.de
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}



More information about the Rpm-maint mailing list