hjuutilainen-recipes
hjuutilainen-recipes copied to clipboard
Make OpenOfficeURLProvider.py work with other Apache downloads?
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_URLwould vary per product. (For Directory Studio it'shttp://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.dmgbut Directory Studio usesApacheDirectoryStudio-<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
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.