Patch 8.2.2698

12 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 3, 2021, 9:36:27 AM4/3/21
to vim...@googlegroups.com

Patch 8.2.2698 (after 8.2.2696)
Problem: Lua test fails on MS-Windows.
Solution: Fall back to old method if "lua -v" doesn't work.
Files: src/testdir/test_lua.vim


*** ../vim-8.2.2697/src/testdir/test_lua.vim 2021-04-03 14:13:29.644785091 +0200
--- src/testdir/test_lua.vim 2021-04-03 15:33:31.101356508 +0200
***************
*** 14,22 ****

" Depending on the lua version, the error messages are different.
let s:luaver = split(split(systemlist('lua -v')[0], ' ')[1], '\.')
let s:major = str2nr(s:luaver[0])
let s:minor = str2nr(s:luaver[1])
! let s:patch = str2nr(s:luaver[2])
let s:lua_53_or_later = 0
let s:lua_543_or_later = 0
if (s:major == 5 && s:minor >= 3) || s:major > 5
--- 14,30 ----

" Depending on the lua version, the error messages are different.
let s:luaver = split(split(systemlist('lua -v')[0], ' ')[1], '\.')
+ if len(s:luaver) < 3
+ " Didn't get something that looks like a version, use _VERSION.
+ let s:luaver = split(split(luaeval('_VERSION'), ' ')[1], '\.')
+ endif
let s:major = str2nr(s:luaver[0])
let s:minor = str2nr(s:luaver[1])
! if len(s:luaver >= 3)
! let s:patch = str2nr(s:luaver[2])
! else
! let s:patch = 0
! endif
let s:lua_53_or_later = 0
let s:lua_543_or_later = 0
if (s:major == 5 && s:minor >= 3) || s:major > 5
*** ../vim-8.2.2697/src/version.c 2021-04-03 15:15:43.871614324 +0200
--- src/version.c 2021-04-03 15:35:13.897117232 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2698,
/**/

--
hundred-and-one symptoms of being an internet addict:
47. You are so familiar with the WWW that you find the search engines useless.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Bram Moolenaar

unread,
Apr 3, 2021, 9:38:42 AM4/3/21
to vim...@googlegroups.com, Bram Moolenaar

I wrote:

> Patch 8.2.2698 (after 8.2.2696)
> Problem: Lua test fails on MS-Windows.
> Solution: Fall back to old method if "lua -v" doesn't work.
> Files: src/testdir/test_lua.vim

This probably still fails with the "lua" command has a different version
than the library that Vim was built with. I hope someone can figure
out a better solution to get the patch level.

--
The real
trick is
this: to
keep the
lines as
short as
possible
and keep
the size
the same
yet free
from the
need for
hyphena-
Dammit!! (Matthew Winn)

Yegappan Lakshmanan

unread,
Apr 3, 2021, 10:46:23 AM4/3/21
to vim_dev, Bram Moolenaar
Hi Bram,

On Sat, Apr 3, 2021 at 6:38 AM Bram Moolenaar <Br...@moolenaar.net> wrote:
>
>
> I wrote:
>
> > Patch 8.2.2698 (after 8.2.2696)
> > Problem: Lua test fails on MS-Windows.
> > Solution: Fall back to old method if "lua -v" doesn't work.
> > Files: src/testdir/test_lua.vim
>
> This probably still fails with the "lua" command has a different version
> than the library that Vim was built with. I hope someone can figure
> out a better solution to get the patch level.
>

Yes. The Lua _VERSION global variable only contains the major and
minor version numbers. It doesn't have the patch version number.
When the lua command is invoked with the "-v" argument, then it
displays all the three version numbers. But if the lua executable is
not present in the PATH or some other version is found, then we may
get the wrong Lua version. I hope someone more familiar with Lua
can chime in with a solution to get the Lua version.

https://www.lua.org/manual/5.3/manual.html#pdf-_VERSION
https://stackoverflow.com/questions/18268528/is-it-possible-to-get-lua-interpreter-version-information-in-script

Regards,
Yegappan

Bram Moolenaar

unread,
Apr 3, 2021, 11:19:30 AM4/3/21
to vim...@googlegroups.com, Yegappan Lakshmanan

> > > Patch 8.2.2698 (after 8.2.2696)
> > > Problem: Lua test fails on MS-Windows.
> > > Solution: Fall back to old method if "lua -v" doesn't work.
> > > Files: src/testdir/test_lua.vim
> >
> > This probably still fails with the "lua" command has a different version
> > than the library that Vim was built with. I hope someone can figure
> > out a better solution to get the patch level.
> >
>
> Yes. The Lua _VERSION global variable only contains the major and
> minor version numbers. It doesn't have the patch version number.
> When the lua command is invoked with the "-v" argument, then it
> displays all the three version numbers. But if the lua executable is
> not present in the PATH or some other version is found, then we may
> get the wrong Lua version. I hope someone more familiar with Lua
> can chime in with a solution to get the Lua version.

I suspect that the executable may be called something else, e.g.
"lua45".

--
hundred-and-one symptoms of being an internet addict:
48. You get a tatoo that says "This body best viewed with Netscape 3.1 or
higher."
Reply all
Reply to author
Forward
0 new messages