As discussed in freenode/#gentoo-portage ... <@dol-sen> hmm, could be an eclean-pkg enhancement ... Reproducible: Always
Created attachment 429080 [details] Example solution in Bash
Created attachment 441322 [details] for FEATURES=binpkg-multi-instance At the end there is some (disabled) broken code for removing packages that have the same USE/IUSE flags, but different checksums (e.g. the package was first built downstream and then later on the binpkg builder).
This would be much easier to do, and maintain, using python/portage APIs. Note that eclean is using portage APIs more now, since the patches from bug 586658.