-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default to latest version when no <version> argument supplied #22
Comments
I didn't understand your statement. Can you give me some additional examples? |
Say you want to download the latest 5.3 release, but don't remember the exact version number, in that case you should be able to write So instead of having to look up what the exact version string is (eg.: 5.3.3), they could write only the first two components (eg.: 5.3) and luaver could automatically look up the correct version and download that. I think this could be implemented even in a single line of shell script with curl and grep and would make usability just a bit better. |
This is not feasible with a single line of shell script because |
I agree that this won't be feasible with a single line shell script. Anyhow, I'm planning to add it as it will improve the usability a lot. |
In the meantime I started prototyping it in a fork . Is it looking ok? Should I do the rest too? |
But how are you going to find out the latest version of lua? |
AFAIK
|
@DhavalKapil I haven't tested it yet, but the basic idea is to parse a semver version string and convert it to a grep pattern, then apply that pattern to the html page we get from the Eg.: |
That's cool. Let me know if you're able to solve this :) |
IMO having static aliases is simple and enough like this: __luaver_resolve_lua_version()
{
case "$1" in
5 | 5.3 ) echo 5.3.3 ;;
5.2 ) echo 5.2.4 ;;
5.1 ) echo 5.1.5 ;;
5.0 ) echo 5.0.3 ;;
* ) echo "$1"
esac
} |
I'd rather not go for hardcoding the version within the source code. |
I'm afraid web-scraping |
Using git tags sounds like a good solution! |
Note that the |
@umireon that really is cleaner, but I think it's more robust to use the original source. Also, sorry, I can't work much on the code this week, I have some important exams, so I can't promise anything. |
@raingloom https://github.com/lua/lua is a kind of the original source. |
You can use case "$1" in
5 ) echo "$1.[0-9]+.[0-9]+" ;;
5.[0-9] ) echo "$1.[0-9]+" ;;
* ) echo "$1"
esac |
lua-all.tar.gz is on the original source and more reliable to obtain the list of versions.
|
As someone who up until recently had terrible internet access, the extra download seems a bit overkill. What if the output of your script was cached into a file in |
Still, downloading all the source code doesn't look good. I prefer the Github tags method. |
I admit the I have presented it just because it is the most probale way to work in the future. |
Since there is no official repository, I guess scraping is good enough, no
matter what we choose, they are all susceptible to changes, but most likely
nothing that can't be fixed relatively easily in the future.
…On Mon, Dec 26, 2016 at 7:10 PM, Kaito Udagawa ***@***.***> wrote:
I admit the lua-all.tar.gz way is stupid and I think that is a bad way to
implement.
I have presented it just because it is the most probale way to work in the
future.
Recently, I found that the lua team currently does not have any public
repo <https://www.lua.org/faq.html#1.8> and the git repository
<https://github.com/lua/lua> may be closed (this is not likely to be
happen, though).
And the design of https://www.lua.org/ftp/ have changed sometimes
<http://web.archive.org/web/*/https://www.lua.org/ftp/> and thus will be.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHtePLQx0jOzVp8zAREv5GRdeMeNjcQNks5rMBELgaJpZM4LF1Ko>
.
|
I think indicating to see downloading area on error is enough in interactive sessions.
This feature will not be so useful in batch sessions (e.g. CI) because the release rate of lua, luajit and luarocks is slow. |
The repositories in https://github.com/lua are semi-official mirrors (they were "blessed" by Roberto to store the development history), and are well-maintained. They can be used to fetch Lua versions. Github repos for LuaRocks and LuaJIT are official, so tags can be fetched from those as well. |
This feature requires the list of candidate remote versions and thus #42 may be helpful. |
Easy way to download lastest lua rocks version: Linux dependency: |
As the title says, I think this wouldn't be hard to implement and would make sure eg. that the latest bugfixes are installed.
Step 2: parse semver string and install latest compatible version
eg.:
luaver install 5.3
will install the latest 5.3 series releaseThe text was updated successfully, but these errors were encountered: