Consider an ~amd64 ebuild that does: RDEPEND=" || ( sys-libs/zlib[abi_ppc_32(-)] sys-libs/zlib[abi_x86_32(-)] ) " If abi_x86_32 dep goes first, --autounmask suggest enabling abi_x86_32 on zlib. If it goes second, portage stops at: emerge: there are no ebuilds to satisfy "sys-libs/zlib[abi_ppc_32(-)]". (dependency required by "dev-libs/libblah-0::mgorny" [ebuild]) (dependency required by "libblah" [argument]) If abi_x86_32 is already in package.use (or global USE), portage correctly adds zlib rebuild to depgraph.
*** Bug 528836 has been marked as a duplicate of this bug. ***
So, we need depzapdeps to prefer choices that require enabling of unmasked flags over choices that require enabling of masked flags.
I have a patch in this branch: https://github.com/zmedico/portage/commits/bug_515584 I've posted it for review here: http://thread.gmane.org/gmane.linux.gentoo.portage.devel/4778
This is in the master branch now: https://github.com/gentoo/portage/commit/20ff16e8941af389cd1fc80e10aef1a90f3b5aa8
This is in the portage-2.2.15 release.