[Rpm-maint] [Patch 3/19] Enable PREREQ
James Olin Oden
james.oden at gmail.com
Fri Feb 9 13:53:18 UTC 2007
On 2/9/07, Michael Schroeder <mls at suse.de> wrote:
> 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.
>
And this is where things like:
rpm -qvv -T -W $path_to_pile_o_packages
is really nice because you can detect a dep loop within a set of
packages before deploying them. That said its still pretty hackish,
and better tools from the standpoint of cleaner reporting would be
welcome.
I know this sounds like a non-sequiter, but my point really is that
dep loops are bad and are typically a packaging problem, and typically
can be solved in packaging (i.e. by splitting up packages, moving
content around and so forth). The PreReq has always carried some
fuzzy semantic IMO that was neither needed nor desirable. I may not
be seeing things clearly though.
BTW, thanks for sending all these patches out on the list the way you
did Paul, as its probably generated more meaningful discussion on list
than I've seen in a while (and maybe even peaked some folks interest).
Cheers...james
More information about the Rpm-maint
mailing list