It seems to me that the problem of building a list from your tree is different than that of resolving different or conflicting dependencies of variuos software packages. So it would be best to split these into different subroutines or modules: the first would meld differing dependencies in the trees and the second would take those melded trees and turn them into lists.

Melding different dependencies is really a policy decision. If there is an inconsistency, do we throw out a package, or do we install both versions? Given a range of possible versions do we always pick the most recent? The most stable? And so on. If you are creating a perl clone of the Portage apps, the policy is already set for you: look at those apps to see what is done in case of dependency conflict.

As you say, the second part is fairly simple: just do a preorder traversal of the tree.

-Mark


In reply to Re: building a dependency tree by kvale
in thread building a dependency tree by agaffney

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.