hjuutilainen-recipes icon indicating copy to clipboard operation
hjuutilainen-recipes copied to clipboard

Make OpenOfficeURLProvider.py work with other Apache downloads?

Open homebysix opened this issue 10 years ago • 1 comments

Hi Hannes,

I'm trying to write an ApacheDirectoryStudio.download recipe, and it looks like the logic necessary to find the nearest mirror is exactly the same logic you're using in your OpenOfficeURLProvider processor.

I wonder if you'd consider changing the specific OpenOfficeURLProvider into a more generic ApacheURLProvider processor, which could be used for downloading other Apache products?

I think the two things that would need to be changed are:

  • The LOCATOR_URL would vary per product. (For Directory Studio it's http://www.apache.org/dyn/aoo-closer.cgi/directory/studio.) Maybe the product-specific part of that URL could become an input variable, like so:
<key>MIRROR_PATH</key>
<string>/openoffice</string>
  • The filename and version regex would vary per product. (OpenOffice uses Apache_OpenOffice_<version>_MacOS_x86-64_install_en-US.dmg but Directory Studio uses ApacheDirectoryStudio-<version>-macosx.cocoa.x86_64.tar.gz.) Perhaps this too could be passed as an input variable?
<key>FILENAME_MATCH</key>
<string>Apache_OpenOffice_[\d]+.*_MacOS_x86-64_install.+\.dmg</string>

I'd be happy to chip in, of course, but I'm new to writing processors.

Elliot

homebysix avatar Aug 04 '15 20:08 homebysix

Thanks for the suggestion. Good idea and I'm definitely up for this. I'll see if I can come up with something based on your specs.

hjuutilainen avatar Aug 05 '15 18:08 hjuutilainen