commit 4a12d49ad3ee5467a78e10cbc5ad25a7c184eaca
Author: Antoine Beaupré <anarcat@koumbit.org>
Date:   Wed May 25 18:34:32 2011 -0400

    check if the download was successful before whining about checksum errors

diff --git a/commands/pm/package_handler/wget.inc b/commands/pm/package_handler/wget.inc
index 76c3dcf..3e84402 100644
--- a/commands/pm/package_handler/wget.inc
+++ b/commands/pm/package_handler/wget.inc
@@ -65,6 +65,14 @@ function package_handler_download_project(&$request, $release) {
     return drush_set_error('DRUSH_PM_DOWNLOAD_FAILED', 'Unable to download ' . $filename . ' to ' . $request['base_project_path'] . ' from '. $release['download_link']);
   }
 
+  // the file may be in the XML dump, but not yet generated
+  if (!file_exists($filename) || filesize($filename) == 0) {
+    drush_set_error('DRUSH_PM_FILE_MISSING', "File $filename is empty.");
+    drush_op('unlink', $filename);
+    drush_op('chdir', $olddir);
+    return FALSE;
+  }
+
   // Check Md5 hash.
   if (drush_op('md5_file', $filename) != $release['mdhash'] && !drush_get_context('DRUSH_SIMULATE')) {
     drush_set_error('DRUSH_PM_FILE_CORRUPT', "File $filename is corrupt (wrong md5 checksum).");
