Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 169046 - >=portage-2.1.2-r10: --tree does NOT show the dependency tree correctly
Summary: >=portage-2.1.2-r10: --tree does NOT show the dependency tree correctly
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks: 167107
  Show dependency tree
 
Reported: 2007-03-02 21:08 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2007-03-03 12:33 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
[Portage 2.1.2-r9] emerge -uDNptv --with-bdeps=y world (emerge-2.1.2-r9,6.65 KB, text/plain)
2007-03-02 21:11 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details
[Portage 2.1.2-r10] emerge -uDNptv --with-bdeps=y world (emerge-2.1.2-r10,2.70 KB, text/plain)
2007-03-02 21:15 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details
[Portage 2.1.2-r13] emerge -uDNptv --with-bdeps=y world (emerge-2.1.2-r13,2.59 KB, text/plain)
2007-03-02 21:17 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details
`sort /var/lib/portage/world` (world,1.50 KB, text/plain)
2007-03-02 21:30 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details
add more "nomerge" nodes to the --tree display (nomerge.patch,6.34 KB, patch)
2007-03-03 00:28 UTC, Zac Medico
Details | Diff
add more "nomerge" nodes to the --tree display (nomerge.patch,6.94 KB, patch)
2007-03-03 01:24 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-03-02 21:08:36 UTC
In >=portage-2.1.2-r10 the dependency tree isn't shown correctly.

From emerge.1:
 --tree (-t)
   Shows the dependency tree for the given target by indenting dependencies.

It is more important than showing the reverse of the actual merge order.

I know about bug #158100. I appreciate showing the reverse of the merge order. I suggest that --tree shows both the reverse of the merge order AND the correct dependency tree.

I attach some emerge outputs.
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-03-02 21:11:56 UTC
Created attachment 111847 [details]
[Portage 2.1.2-r9] emerge -uDNptv --with-bdeps=y world
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-03-02 21:15:39 UTC
Created attachment 111849 [details]
[Portage 2.1.2-r10] emerge -uDNptv --with-bdeps=y world

Outputs of r{11,12} differ only in line:
[ebuild     U ] sys-apps/portage-2.1.2-r13 [2.1.2-r10] USE="-build -doc -epydoc (-selinux)" LINGUAS="pl" 0 kB
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-03-02 21:17:09 UTC
Created attachment 111852 [details]
[Portage 2.1.2-r13] emerge -uDNptv --with-bdeps=y world
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-03-02 21:30:32 UTC
Created attachment 111854 [details]
`sort /var/lib/portage/world`
Comment 5 Zac Medico gentoo-dev 2007-03-02 21:40:53 UTC
I think I can make the --tree display work better while still displaying packages in the exact reverse merge order.  It seems like it's just a matter of adding "nomerge" nodes wherever possible.

Note that the --tree display is inherently flawed because it can't show multiple parents of a given node.  To solve that, will have to add a new option (see bug #169047).
Comment 6 Zac Medico gentoo-dev 2007-03-03 00:28:44 UTC
Created attachment 111872 [details, diff]
add more "nomerge" nodes to the --tree display

This patch should mostly solve the problem.  It inserts "nomerge" nodes in order to fill in the tree structure.  Packages may appear in the display list multiple times, and will be marked "nomerge" when their position in the list does not correspond to actual merge order.

One flaw in the algorithm as implemented in this patch is that it stops filling in the parents when it encounters a dependency cycle (I noticed this while looking at the output of `emerge -pet world`).  It should work pretty well for most cases though.
Comment 7 Zac Medico gentoo-dev 2007-03-03 01:24:44 UTC
Created attachment 111873 [details, diff]
add more "nomerge" nodes to the --tree display

This improved version actively avoids direct cycles in order to increase the likelihood of traversing all the way up to a root node.  It's in svn r6136.
Comment 8 Zac Medico gentoo-dev 2007-03-03 12:33:32 UTC
This has been released in 2.1.2-r14.