takari / jdkget

Get a JDK! So easy!
22 stars 11 forks source link

Should support short -v versions #2

Closed paul-hammant closed 8 years ago

paul-hammant commented 8 years ago

1) 1.8 should mean latest of JDK 8 series, 2) as should 8 (w/o the 1. prefix)

jvanzyl commented 8 years ago

We can map those abbreviations, but we were just trying to map actual versions to start. But good suggestion. We just need to keep a mapping somewhere but easy to do.

atanasenko commented 8 years ago

I have an almost working parser that extracts a list of jdk versions from oracle website. It does assume that the way they are listed in html (well, js actually) does not change though. We could use that to first gather a list of versions and then choose the latest that meets the required 'shortened' version. Say, 8, 1.8, 1.8.0, 8u91, 1.8.0_91 will all be resolved to 8u91_b14 (8u92 is a PSU release, and we should probably follow the PSU/CPU recommendations as well).

Alternatively, we can have a static list of versions but we will need to update it regularly and users will need to update jdkget regularly as well. Alternatively2, we can have this static list available on the net somewhere (right here on github) and jdkget will fetch it instead of parsing oracle.com.

WDYT?

paul-hammant commented 8 years ago

If you're going to do any extract fu from oracle (and others), then the destination should indeed be a json/yaml/toml reference within this repo. Doing it periodically is fine.

atanasenko commented 8 years ago

Fixed in #14. It now accepts versions of the form 1.8.0_101-b13, 8u101-b13, 8u101, 8. Since the list is now static here on github we can just match those versions against a list of known ones and pick one that is most recent.