mozilla/mozdownload — pull request #23 by mykmelez (2012-09-07 20:29:40+00:00)
Title: add support for downloading b2g builds

Here are two changes that add support for downloading b2g daily builds. The first, which is a one-liner, just adds "b2g" to the list of supported applications. The second, which is more complicated, adds a "windows extension" option for specifying that the file extension of a windows build to download be ".zip" instead of the default ".exe", since we don't build b2g installers, just ZIP packages.

Supporting .zip is tricky for two reasons:

1. we also build files ending in .tests.zip, so the scraper has to make sure it doesn't download one of those instead;
2. .exe builds have the extra string ".installer" before the file extension, which we have to account for.

The patch makes sure to take both of these factors into account, and I've tested to make sure Firefox and Thunderbird daily builds continue to be downloaded correctly.

I made the "windows extension" option be daily-specific for two reasons:

1. we don't build ZIP packages for release and candidate builds, so there's no need to specify an extension for those scrapers;
2. the tinderbox scraper uses a more ambiguous regex that doesn't check for a platform substring, and it isn't clear that I can add support for specifying a file extension there without breaking some existing use case.