Closed schnupperboy closed 8 years ago
Hmm... Wouldn't it be better to grab the latest version from the tag list? Doing this every six week won't be too fun...
I think this should do the trick, unless they decide to retroactively add tags:
git for-each-ref --sort=-taggerdate --count=1 --format '%(tag)' refs/tags
An other idea is to filter out the x.y.z
formated tags and version sort them, but I don't know if there is a portable way to do that.
I'd prefer the latter since it still works -- like you already said -- even if they decide to retroactively add tags.
Portability isn't important in my opinion because we control the build environment of the cross compiler (debian jessie at the moment).
What about something like:
git tag --list [[:digit:]].[[:digit:]].[[:digit:]] | sort | tail --lines 1
Portability isn't a big deal because we control the build environment of the cross compiler (debian jessie at the moment).
True. It's better than relying on the taggerdates.
git tag --list [[:digit:]].[[:digit:]].[[:digit:]] | sort | tail --lines 1
We have to take multi-digit numbers into account, so version sort (sort -V
) is essential. Will [[:digit:]]
match multiple digits?
We have to take multi-digit numbers into account, so version sort (sort -V) is essential. Will [[:digit:]] match multiple digits?
No it doesn't. This is better:
git tag --list | grep "^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}$" | sort -V
Yeah, that or without upper limits:
git tag --list | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$" | sort -V
I implemented what you suggested in your last comment (version numbers without upper limits), see my latest commit. Anything missing?
I think that's it. I would appreciate it if you could squash the commits into one, and edit the PR title and description to reflect this new strategy.
Done :)
Great, thank you!
I updated the git references for the rust repo inside the Dockerfile and it's documentation to 1.5.0 since it has been released as the new stable version...
Update: A mechanism was implemented which auto-detects the latest version number of rust stable by using the tags of the rust git repository. This avoids hard coding the version number.