[DCPM] hierarchies

Simon Waters simon at technocool.net
Fri Dec 15 17:10:39 PST 2006


Neil Williams wrote:
> 
>> Can you define what problem you are trying to solve, rather than
>> what you think you need to do to solve it.
> 
> A 'system' (which may be not much more than an ISO image or chroot
> jail) has a (small) set of packages A and needs a (large) set of
> packages B. Packages are available elsewhere to go from A to B but
> these are incompatible with A so each package must be rebuilt using
> only packages already available in set A. Once successfully built,
> new packages get included into set A so that you incrementally move
> closer to a full set B. By following the known dependencies of
> packages within B, identify the sequence that can build all packages
> in set B starting from set A. i.e. this is Build-Depends, rather than
> the binary depends.

If the problem is "how to build B" given A, you don't need to solve this
elaborate problem.

Grow the dependency tree from B till it is complete, which is a trivial
problem to handle with recursion. Terminate the recursion when you hit a
package which is in A, or one you already included.

Now loop over the list building any unbuilt package in the list that
already has its dependencies. Loop over the list until everything is
built, or until an iteration over the loop doesn't improve anything (at
which point you know the problem has no solution).

Presumably you can do this second step "virtually" to check a solution
exists, before doing anything expensive.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 288 bytes
Desc: OpenPGP digital signature
Url : http://mail.pm.org/pipermail/devoncornwall-pm/attachments/20061216/397dfa84/attachment.bin 


More information about the Devoncornwall-pm mailing list