I had a nasty bug whenever I executed 'emerge clean': portage always told me, that I had an invalid /var/db/pkg entry for devfsd: >>> Auto-cleaning packages ... !!! Invalid db entry: /var/db/pkg/*sys-fs/devfsd!!! Invalid db entry: /var/db/pkg/*sys-fs/devfsd!!! Invalid db entry: /var/db/pkg/*sys-fs/devfsd!!! Invalid db entry: /var/db/pkg/*sys-fs/devfsd >>> No outdated packages were found on your system. first, I tried to unmerge sys-fs/devfsd and then emerged it anew, but that didn't fix the problem. The problem lay in the portage source: The routine, that should detect incomplete merges had a problem: it looked for the string '.*/-MERGING-(.*)', but incomplete merges can only be detected with '.*/-MERGING-.*', since the brackets went away sometime ago. I attached a patch that fixes it.
Created attachment 21968 [details, diff] patch to detect incomplete merges correctly
*** This bug has been marked as a duplicate of 31881 ***