* Building file list for packages cleaning...
!!! Invalid binary package: '/usr/portage/packages/media-gfx/imagemagick-18.104.22.168.tbz2'
!!! Missing metadata key(s): CATEGORY, PF, SLOT. This binary package is not
!!! recoverable and should be deleted.
* Your packages directory was already clean.
Since it identifies the invalid package it should delete it itself instead of telling the user to delete it manually.
The portage API has a binarytree.invalids list, but unfortunately it doesn't contain full paths. We're probably going to need a new portage API for this.