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

Bug#267619: how to deal with a chain of dependencies



Lets say the user wants to apt-get package "foo". Package
"bar" is marked for install due to a long chain of dependencies
for foo, e.g.

package: foo --> d1 --> d2 --> d3 --> d4 --> d5 --> bar

Today apt-get assumes that if d1 is missing, then foo
will not work. This means the probability to break foo by
not installing d1 is assumed to be 1.0. There is a
similar relationship between all other packages and their
next dependent package in this chain, i.e. the probability
to break foo by not installing bar is assumed to be 1.0.

If we extend the Depends: field in the package header by
a numeric dependency value for each listed package, describing
the probability to break the requested package if the
dependent package is not installed, then the dependency chain
of the example would look like this:

package: foo --> d1 --> d2 --> d3 --> d4 --> d5 --> bar
depvalue   1.0    1.0    1.0    1.0    1.0    1.0

But if each package would list a more realistic depvalue
for it dependencies, then the chain might look like
this

package: foo --> d1 --> d2 --> d3 --> d4 --> d5 --> bar
depvalue   0.8    0.8    0.5    0.2    0.3    0.8

If you multiply the numbers, then the probability to break foo
if bar is missing is calculated to be 0.015. Lets assume the
user has set a threshold for installing dependent packages
to 0.02, so bar is not installed. d[1-5] are installed, because
they are above threshold.

Of course a missing package bar would break package (lets say)
d4 with a probability of 0.24, which is much higher than the
threshold. But please remember that the user has not requested
d4 to be installed.


Regards

Harri



Reply to: