Gentoo Archives: gentoo-dev

From: Jason Stubbs <jstubbs@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Multiple Repo Support
Date: Tue, 27 Dec 2005 16:27:28
Message-Id: 200512280120.50600.jstubbs@gentoo.org
In Reply to: Re: [gentoo-dev] Multiple Repo Support by Paul de Vrieze
1 > On Monday 26 December 2005 21:28, Ciaran McCreesh wrote:
2 > > On Mon, 26 Dec 2005 21:09:31 +0100 Carsten Lohrke <carlo@g.o>
3 > > Well, any library that changes ABI should use a different SLOT for each
4 > > revision. So SLOT depends should be able to replace the need for = and
5 > > ~ and < and <= dependencies entirely. Which is a good thing, since
6 > > those atoms make dependency resolution a general-case unsolvable
7 > > problem.
8
9 There's a lot of "should"s that are "aren't"s in there, but in principle that
10 is a very elegant idea.
11
12 On Wednesday 28 December 2005 00:48, Paul de Vrieze wrote:
13 > Well, it shouldn't be unsolvable. Choosing can be done with the following
14 > process:
15 >
16 > - Get the list of packages with the requested name.
17 > - Sort the list from the newest version, to the oldest.
18 > - Iterate over the packages:
19 > - Apply all restrictions on the package (including exclusions). If the
20 > package satisfies all, test it's dependencies recursively.
21 ^^^ This step fails. When the set of restrictions cannot be resolved,
22 you need to backtrack and try a lesser version of a previous
23 package hence the set of "all restrictions" is constantly in flux.
24 > - If all dependencies match, this package matches the dependency.
25 > Continue with the next depend atom.
26 > - If no match, iterate the next package.
27
28 If backtracking was all there was to it, it could be done very quickly of
29 course. However, it's essentially a brute force method; I'm not very good
30 with O notation but I think it's O(n^n). I've got an algorithm in my head
31 that'll do it but it goes into an infinite loop in the cases that Carsten
32 mentioned. That's why things are taking so long. I should really write it
33 down...
34
35 </plea for help?>
36
37 --
38 Jason Stubbs
39 --
40 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Multiple Repo Support Ciaran McCreesh <ciaranm@g.o>