today i had the md5 digest verification failed error again. after this error emerge exits. i think it would be better if emerge tries to download the file again from another mirror. and to prevent an infinite loop add an option like "EMERGE_MAX_DOWNLOAD_RETRIES=5". that means if it downloads the file from a mirror with failed md5 sum retry 4 other mirrors and then exit. another possibility would be a "homepage fallback": if the md5sum fails try to download the file from the orginal homepage and if this also gives an invalid md5sum -> exit
Portage does try to re-download the file if the size is different to the recorded size, but if the MD5 is different then redownloading automatically is generally not a good idea. While re-downloading the file may be fine in some cases, usually it's just wasted bandwidth from the mirrors.