diff -u release/package-release-nodes.php release/package-release-nodes.php --- release/package-release-nodes.php 13 Nov 2010 01:50:23 -0000 +++ release/package-release-nodes.php 21 Dec 2010 14:36:12 -0000 @@ -356,15 +356,18 @@ } } - if (!drupal_exec("$tar -c --file=- $release_file_id | $gzip -9 --no-name > $full_dest_tgz")) { + // On d.o, the download tables are sorted by fid DESC, so we'll package zip + // first and insert it into {files} before tgz so that tgz still shows up as + // the first download option. + if (!drupal_exec("$zip -rq $full_dest_zip $release_file_id")) { return 'error'; } - $files[] = $file_path_tgz; + $files[] = $file_path_zip; - if (!drupal_exec("$zip -rq $full_dest_zip $release_file_id")) { + if (!drupal_exec("$tar -c --file=- $release_file_id | $gzip -9 --no-name > $full_dest_tgz")) { return 'error'; } - $files[] = $file_path_zip; + $files[] = $file_path_tgz; // As soon as the files exist, we want to update the DB about it. package_release_update_node($nid, $files); @@ -476,12 +479,6 @@ } } - // 'h' is for dereference, we want to include the files, not the links - if (!drupal_exec("$tar -ch --file=- $to_tar | $gzip -9 --no-name > $full_dest_tgz")) { - return 'error'; - } - $files[] = $file_path_tgz; - if (!$is_translation) { if (!drupal_exec("$zip -rq $full_dest_zip $to_tar")) { return 'error'; @@ -489,6 +486,12 @@ $files[] = $file_path_zip; } + // 'h' is for dereference, we want to include the files, not the links + if (!drupal_exec("$tar -ch --file=- $to_tar | $gzip -9 --no-name > $full_dest_tgz")) { + return 'error'; + } + $files[] = $file_path_tgz; + // Start with no package contents, since this is only valid for profiles. $package_contents = array(); @@ -572,16 +575,16 @@ } // Package the no-core distribution. - // 'h' is for dereference, we want to include the files, not the links - if (!drupal_exec("$tar -ch --file=- $project_short_name | $gzip -9 --no-name > $no_core_full_dest_tgz")) { + if (!drupal_exec("$zip -rq $no_core_full_dest_tgz $project_short_name")) { return 'error'; } - $files[] = $no_core_file_path_tgz; + $files[] = $no_core_file_path_zip; - if (!drupal_exec("$zip -rq $no_core_full_dest_tgz $project_short_name")) { + // 'h' is for dereference, we want to include the files, not the links + if (!drupal_exec("$tar -ch --file=- $project_short_name | $gzip -9 --no-name > $no_core_full_dest_tgz")) { return 'error'; } - $files[] = $no_core_file_path_zip; + $files[] = $no_core_file_path_tgz; // CORE DISTRIBUTION. @@ -612,16 +615,16 @@ $core_full_dest_zip = "$dest_root/$core_file_path_zip"; // Package the core distribution. - // 'h' is for dereference, we want to include the files, not the links - if (!drupal_exec("$tar -ch --file=- $core_build_dir | $gzip -9 --no-name > $core_full_dest_tgz")) { + if (!drupal_exec("$zip -rq $core_full_dest_zip $core_build_dir")) { return 'error'; } - $files[] = $core_file_path_tgz; + $files[] = $core_file_path_zip; - if (!drupal_exec("$zip -rq $core_full_dest_zip $core_build_dir")) { + // 'h' is for dereference, we want to include the files, not the links + if (!drupal_exec("$tar -ch --file=- $core_build_dir | $gzip -9 --no-name > $core_full_dest_tgz")) { return 'error'; } - $files[] = $core_file_path_zip; + $files[] = $core_file_path_tgz; // Development releases may have changed package contents -- clear out // their package item summary so a fresh item summary will be inserted.