This enhancement proposal is to add a hook so that whenever an __updated or new__ copy of the Packages file from a binary package host is fetched, the hooked script will parse the file. A directory under /etc/portage will need to be created, similar to the repo.postsync.d directory. If the script returns a non-zero exit code, then the fetch of the file is considered failed. If multiple servers are listed in PORTAGE_BINHOST, the next should be tried. If all servers fail then the emerge process should stop. The script arguments are: 1. Path to a temporary copy of Packages. 2. The full URL path that the Packages file was fetched from. My primary use case is to verify a detached signature of the Packages file. This would be done by fetching something like ${2}.asc and checking the signature of the given file path.
This is obsolete given we have proper GPG support now (bug 266879).