Created attachment 321438 [details, diff] _pkgname() checks 'md5-cache' and 'cache folders' under $portdir/metadata/ _pkgname function needs to check both ${portdir}/metadata/cache and ${portdir}/metadata/md5-cache as we don't know about cache-format used in in overlays installed on machine of the user. I attached the patch in the format given by 'git format-patch'.
Thanks. There were also a couple places in _emerge that needed updating. http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=8609efe8432a76300d7208b16c19a7305b96aa8a
Fixed in 20121024.