Re: Conditional dependancies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 8 Apr 2004, Rob van der Heij wrote:

> I would like my package to conditionally require some version of another
> package, like "if you have package foo then you need nn.nn or better"
> 
> Don't see how I can do that with manual dependencies. And I don't think
> the preinstall script can refuse installation either, can it?
> 
> Any suggestions on how this could be done?  Rob
>
The %pre script can refuse to install (exit with a 1 or some other 
positive return code).  Problem if multiple rpm's are being installed,
some may have already been installed before yours.  Additionally, by 
default rpm delivers packages as a best effort, so if one package fails
once the transaction is running (this is after all the space and 
dependency checks) then the transaction just keeps on running (with 
anaconda this is typically a good thing).   So just dying like that in the 
middle of a transaction, could have bad consequences (like other packages 
depending on your package being delivered also running off the rails).
Not to mention what you really want is a conditional depedency such that 
the transaction will fail before it ever really starts running and the 
system is touched at all.

That being said, though what you want seems reasonable, I am not so sure 
it would be so easy to implement.  Certainly, the rpmtsCheck() (the thing
that makes sure all dependencies are met) could get it right pretty 
easily, but the dependency sorting might get a little crazy.  

What I think you have to do today, is mostly a comprimise, and that is
generate a specfile that depending on what macros you pass it builds
one way or another.  In this way from the same spec file you can generate
an rpm that works with on set of dependencies, and then another that works 
with the other set of dependencies.  I think /usr/share/docs/rpm-$version
has info under conditionalbuilds.

If you really, don't want to comprimise and want such a dependency 
feature, then probably you have a couple of paths:

	1) submit an RFE in bugzilla
	2) discuss it with some of the rpm developers at irc.freenode.org
	   in the #rpm channel.
	3) try to add the functionality yourself, along the way bug many 
	   people with questions, and read a lot of rpm source (-;

I don't know if what your talking about is being looked at by any of the
rpm developers, but it seems to be reasonable, just not something that 
would filter up as a real high priority (for instance, my concern is 
transactional rollbacks, and the autorollback feature, so I can definately 
tell you what you are asking for is not a priority form me...I work on rpm 
in my spare time, and whenever I can reasonably spend time at work; i.e. 
its not my full time job, and my employers priorities are the ones I work 
by generally).

Cheers...james
> 
> _______________________________________________ > Rpm-list mailing list
> Rpm-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/rpm-list
> 


_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux