When new versions of the releases are created, the release date is not updated on drupal.org. This reflects
how the tarballs are generated--nightly for all projects, rather than as needed based on updates.

The attached patch introduces a new field, 'hash', into project_releases, to store file hashes as generated by PHP's md5_file() function. When a new scan is done, the current hash is compared with the previously stored one. If it is different, the $file->changed value is updated.

I've also added in a bit of additional display data for releases: file sizes, and changed dates as well as initial release dates.

Before this can be applied, we'll need an update script to set the initial values of the file hashes, so that all existing $release->changed dates aren't reset to time() (now). I'll get to work on an update script.

Comments

killes@www.drop.org’s picture

the patch looks ok to me. Don 't have a setup to test it, though.

two comments:
$links[] = 'path . '">' . t('Download latest release (%version, %date)',

Can't we use l()?

also, I'd like to display the md5 hash so people can compare their downloaded tarballs to what is available on drupal.org.

dries’s picture

We have a format_size() function you can use. It's slightly nicer and more accurate. Otherwise this patch looks good.

nedjo’s picture

StatusFileSize
new5.33 KB

Here's a revised patch. It uses format_size() and outputs the md5_file hash in the release listings.

Can't we use l()?

Not for the file downloads, because (when clean urls aren't present) it would prepend a ?q= to the file path.

Working today on an update script.

dries’s picture

Patch looks good. Feel free to commit as soon an upgrade path is available.

nedjo’s picture

Here's an update script. It's a bit complicated because it needs to do a directory scan and read in initial file hashes.

If no one finds any problems with this, I'll apply the patch in a couple of days.

dries’s picture

I ran this script on a copy of the Drupal site. I didn't encounter any errors. It has updated 914 release hashes.

nedjo’s picture

Status: Needs review » Fixed

Applied.

Anonymous’s picture

Status: Fixed » Closed (fixed)