autopkg / hansen-m-recipes

My recipes for Autopkg - https://github.com/autopkg
27 stars 50 forks source link

Firefox Win recipe versions #37

Closed patgmac closed 8 years ago

patgmac commented 8 years ago

Is it possible to get the version from the Firefox-Win and FirefoxESR-Win download recipes?

hansen-m commented 8 years ago

Mozilla changed the structure of their downloads page not long ago and at the time I didn't see an easy way to scrape it from the page. Normally when downloading the link via a browser the filename would reflect the version number but URLDownloader and CURLDownloader default to naming the file to the tail end of the url, which wouldn't work in this case. Not sure if there are any options to use the filename given by the headers (I think that is how it works)?

I can share parts of my internal .bigfix recipes but essentially what I do is use my Shared Processor to extract the exe using 7z and then use the BESRelevanceProvider (works outside of BigFix) to read the version from a file and string pattern inside the exe. I'm planning on moving the BESRelevanceProvider over as a Shared Processor, if that is something you'd be interested in using. Otherwise I'm open to suggestions.

patgmac commented 8 years ago

7z and BESRelevanceProvider is currently how you're handling Chrome, correct?

hansen-m commented 8 years ago

Yep, very similar method.

https://github.com/autopkg/hansen-m-recipes/blob/master/Google/GoogleChrome-Win.download.recipe#L33

I've added the BESRelevanceProvider to the SharedRecipes.

https://github.com/autopkg/hansen-m-recipes/blob/master/SharedProcessors/BESRelevanceProvider.py

If you need it I'd be happy to share snippets from my Firefox-Win .bigfix recipes, or even consider move the version processor steps over to the download recipe. I know having the non-standard processors with the extra dependencies have caused some confusion, so not sure what the best approach will be going forward.

patgmac commented 8 years ago

Having the version in the download recipe would be great. My ultimate goal is to make a lanrev recipe that uses your download recipe as a parent and adds the %version% to the file name.

hansen-m commented 8 years ago

Sure, I'll try to get those updated early next week. Getting the version added to the filename should be easy enough with the Copier processor (I do something similar to copy out to a file share), but couldn't you just use the %version% variable in your LANRev child recipe?

patgmac commented 8 years ago

Yes, if %version% is determined in a parent recipe. I do this with Chrome recipes. https://github.com/autopkg/patgmac-recipes/blob/master/Google%20Chrome/GoogleChrome-Win32.LANrev.recipe

jgstew commented 8 years ago

Glad to see others making use of windows AutoPkg recipes.

hansen-m commented 8 years ago

Try this https://github.com/autopkg/hansen-m-recipes/commit/83a852b039ffa97593bf2c1c2468e14e2365c29d

patgmac commented 8 years ago

Works good. Thanks!