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

Bug#275379: apt-get: please support "satisfy"



Hi,

On Thu, 22 Dec 2016 15:01:44 +0100 Johannes Schauer <josch@debian.org> wrote:
> On Mon, 17 Oct 2016 07:20:43 +0800 Paul Wise <pabs@debian.org> wrote:
> > * Use python-apt to do the resolution and emit `apt install pkg=1.2.3` commands?
> 
> I don't see a way to achieve this with python-apt. Even when manually iterating
> through the given dependency string and checking which package in the apt cache
> satisfies the dependency, the solution would not always be correct. Here is an
> example in which this approach would fail:
> 
> Suppose there are the packages A, B, C and D. A depends on D and D conflicts
> with C. Now the wants the following resolved:
> 
> 'A | B, C'
> 
> With the algorithm sketched above, A and C would be picked for installation but
> the solution would be invalid because A and C conflict via D. To avoid this
> situation, the code has to traverse all dependency trees which would in turn
> lead to the implementation of a full-fledged resolver. Certainly this is not
> desired.

on IRC, juliank informed me that this approach is already implemented in
python-apt. Specifically, try to do:

$ python3 -c "import apt.debfile; a = apt.debfile.DebPackage(); a.satisfy_depends_str('nginx-light | apache2, nginx-full'); a.check(); print(a.required_changes)"
(['nginx-full'], [], [])

That result is clearly wrong because it failed to satisfy the first alternative
(nginx-light and nginx-full conflict).

On the other hand, if I hand the problem to the script I presented in my last
email, then I get a correct list including apache2 and nginx-full.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature


Reply to: