xcache doesn't get updated on a package.mask change. This patch causes/uses mtimes of the xcache.p and package.mask to determine if the cache is OK. http://gentoo.twobit.net/portage/portage.py-2.0.15-xcache-mask.diff
This DOES NOT touch the KEYWORDS related issue... KEYWORDS need to be checked too.
Duplicate; patch doesn't address profile inclusion mask so I need to use another method. *** This bug has been marked as a duplicate of 5168 ***