# cat /etc/portage/env/A USE="static-libs" # cat /etc/portage/package.env/A sys-apps/dbus A # emerge -Opv sys-apps/dbus These are the packages that would be merged, in order: [ebuild R ] sys-apps/dbus-1.8.6::gentoo USE="X static-libs* -debug -doc -selinux -systemd {-test}" ABI_MIPS="(-n32) (-n64) (-o32)" ABI_PPC="(-32) (-64)" ABI_S390="(-32) (-64)" ABI_X86="(64) -32 (-x32)" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB # emerge -Opv sys-libs/e2fsprogs-libs These are the packages that would be merged, in order: [ebuild R ] sys-libs/e2fsprogs-libs-1.42.12::gentoo USE="nls -static-libs" ABI_MIPS="(-n32) (-n64) (-o32)" ABI_PPC="(-32) (-64)" ABI_S390="(-32) (-64)" ABI_X86="(64) -32 (-x32)" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB # emerge -Opv sys-apps/dbus sys-libs/e2fsprogs-libs These are the packages that would be merged, in order: [ebuild R ] sys-apps/dbus-1.8.6::gentoo USE="X static-libs* -debug -doc -selinux -systemd {-test}" ABI_MIPS="(-n32) (-n64) (-o32)" ABI_PPC="(-32) (-64)" ABI_S390="(-32) (-64)" ABI_X86="(64) -32 (-x32)" 0 KiB [ebuild R ] sys-libs/e2fsprogs-libs-1.42.12::gentoo USE="nls static-libs*" ABI_MIPS="(-n32) (-n64) (-o32)" ABI_PPC="(-32) (-64)" ABI_S390="(-32) (-64)" ABI_X86="(64) -32 (-x32)" 0 KiB Total: 2 packages (2 reinstalls), Size of downloads: 0 KiB See how static-libs is incorrectly enabled for sys-libs/e2fsprogs-libs in the last command.
Created attachment 384382 [details, diff] config.setcpv: fix bug #522362 Fix config.setcpv to regenerate USE settings in order to account for package.env USE settings from the previous package instance.
I'll be maintaining this patch in the following branch: https://github.com/zmedico/portage/tree/bug_522362 In addition to the attached patch, it also includes a test case.
I've pushed this to master as commit afe9939fc89927346806e8013535bcc15688cb69.
This is fixed in 2.2.13.