Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 275823

Summary: sys-apps/portage - emerge: --tree may lead to suboptimal handling of weak blocks
Product: Portage Development Reporter: Sebastian Luther (few) <SebastianLuther>
Component: CoreAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: esigra
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=537080
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 155723    

Description Sebastian Luther (few) 2009-06-29 13:16:55 UTC
Consider the following case:

deps:
Q: || ( Q-1 Q-2)
Q-1: W-1
Q-2: none
W-1: !Q-2

status:
Q-2 installed

command:
emerge =Q-1

expected result:
install W-1, upgrade Q-1 (in any order)

actual result:
(1)
emerge --ignore-default-opts -qp =Q-1.0
[ebuild  N    ] dev-libs/W-1.0
[ebuild     UD] dev-libs/Q-1.0 [2.0]
[blocks b     ] =dev-libs/Q-2.0 ("=dev-libs/Q-2.0" is blocking dev-libs/W-1.0)

This one is correct, except that the last line should be omitted from the output.

(2)
emerge --ignore-default-opts -qp --tree =Q-1.0
[nomerge      ] dev-libs/Q-1.0 [2.0]
[nomerge      ]  dev-libs/W-1.0 
[uninstall    ]    dev-libs/Q-2.0 
[blocks b     ]   =dev-libs/Q-2.0 ("=dev-libs/Q-2.0" is blocking dev-libs/W-1.0)
[ebuild     UD]    dev-libs/Q-1.0 [2.0]
[ebuild  N    ]     dev-libs/W-1.0 
[blocks B     ]   =dev-libs/Q-2.0 ("=dev-libs/Q-2.0" is blocking dev-libs/W-1.0)

This one is suboptimal.
Comment 1 Sebastian Luther (few) 2009-06-30 15:11:09 UTC
In _serialize_tasks: 
     if ignore_priority is None and not tree_mode:
changing this to 
     if ignore_priority is None:

results in:
[nomerge      ] dev-libs/Q-1.0 [2.0]
[nomerge      ]  dev-libs/W-1.0 
[blocks b     ]   =dev-libs/Q-2.0 ("=dev-libs/Q-2.0" is blocking dev-libs/W-1.0)
[ebuild     UD]    dev-libs/Q-1.0 [2.0]
[ebuild  N    ]     dev-libs/W-1.0 
for case (2), which is correct and optimal.

I checked parts of my emerge -et system and emerge -et world for errors and couldn't find one (note that it changes the order). 
Comment 2 Sebastian Luther (few) 2009-06-30 15:21:10 UTC
Ahh, forget it, it got the order wrong now :(