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.
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).
Ahh, forget it, it got the order wrong now :(