Closed svein closed 11 years ago
On a closer look the problem is in the line TAG=git tag -l | tail -n1
git tag -l prints:
v7.10-1
v7.2-1
v7.3-1
v7.3-2
v7.4-1
v7.4-2
v7.5-1
v7.5-2
v7.6-1
v7.7-1
v7.9-1
and now we don't want the last, but the first. quick fix is to use head in stead of tail, but it will break when v7.11 comes out...
isnt there a way to rename them?
v7.10-1 v7.02-1 v7.03-1 v7.03-2 v7.04-1 v7.04-2 v7.05-1 v7.05-2 v7.06-1 v7.07-1 v7.09-1 and this would fix?
isnt there a way to rename them? probably but then you'll have to ask https://github.com/rraptorr. And I guess changing name on all previous git tags is a lot of work. Better to use a different way to get latest version. Since we know all new releases will be in 10,11..20 etc. we can just grep -v "v.7.0" and use tail from there.
I'm not sure if it's ideal, but you can change line 421 from:
TAG=git tag -l | tail -n1
to:
TAG=git tag -l | sort -t . -k 2 -g | tail -n1
I'd suggest git tag -l | sort -h -k1.2 | tail -n1 instead. That should work as long as all tags have syntax "v" followed by a number. The "-h" is GNU specific and if that's a problem "-n" should result to similar order for these tag names.
In fact, I guess sort -n -k1.2
should be better choise in any case because there's no reason to expect names such as "v7.2k" to mean same as v7.2000".
I've not checked to see if this option is widely supported, but sort has a -V option which causes it to treat it's input as a list of Version numbers: ( http://linux.die.net/man/1/sort )
TAG=git tag -l | sort -V | tail -n1
seems to fix the issue for me
I have opened a pull-request for the solution I propose above.
What is the reason to checkout the specific tag anyway? With the git clone a couple of lines earlier we already get the latest and that should be all we need, right?
from what I can tell, checking out a specific tag is intended to allow the script to be tailored to a specific JDK release. oracle is notorious for making their site VERY hard to scrape -- be it just crappy code or through actual intent.
checking out the latest tag as a basis for the script to do it's work, allows for the maintainer to commit into master without breaking proven/existing functionality -- ideally the latest tag version will continue to work, regardless of the status of master.
Seems like http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase7-521261.html doesn't have the updated java-7u10 listed and therefore gets the uld 7u9 instead. http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html list the correct one