Vera - Show Lua Module Versions

Hi

I came across a piece of code thats scans all my Lua files to see if any have a version reference recorded anywhere. I did this because I was interested to know the version of some of the key Lua modules, especially luasec/https

See code and findings below.

local command = io.popen("find . -type f -name '*.lua' | xargs grep -H 'VERSION *=[^=]'")
local response = command:read("*a")
print(response)

And this is what I got back…

./mios/usr/lib/lua/ssl/https.lua:_VERSION = "0.4"
./rom/usr/lib/lua/ltn12.lua:_M._VERSION = "LTN12 1.0.3"
./rom/usr/lib/lua/luci/ltn12.lua:_VERSION = "LTN12 1.0.1"
./rom/usr/lib/lua/luci/model/uci.lua:APIVERSION = uci.APIVERSION
./rom/usr/lib/lua/soap/server.lua:_VERSION = "LuaSOAP 2.0.1 service helping functions"
./rom/usr/lib/lua/soap.lua:_VERSION = "LuaSOAP 2.0.1"
./rom/usr/lib/lua/socket/url.lua:_M._VERSION = "URL 1.0.3"
./rom/usr/lib/lua/ssl/https.lua: _VERSION = "0.8",
./rom/usr/lib/lua/ssl.lua: _VERSION = "0.8",
./tmp/upnp-event-proxy.lua:local API_VERSION = "3"
./usr/lib/lua/ltn12.lua:_M._VERSION = "LTN12 1.0.3"
./usr/lib/lua/luci/ltn12.lua:_VERSION = "LTN12 1.0.1"
./usr/lib/lua/luci/model/uci.lua:APIVERSION = uci.APIVERSION
./usr/lib/lua/soap/server.lua:_VERSION = "LuaSOAP 2.0.1 service helping functions"
./usr/lib/lua/soap.lua:_VERSION = "LuaSOAP 2.0.1"
./usr/lib/lua/socket/url.lua:_M._VERSION = "URL 1.0.3"
./usr/lib/lua/ssl.lua: _VERSION = "0.8"

Does anyone know what all the different areas are for, and also why at times there are different versions ? You’ll notice they have https.lua in 3 places, between v0.4 and v0.8 ?!!??

From what I understood is the run time looks first at /mios/usr/lib, then /usr/lib. The /rom is a read only that I think are used for factory reset only.

I have no idea why the old https.lua is in /mios/usr/lib, but we did ask if it can be removed in the 7.32 release so the 0.8 version gets used to run time, but that has not happened yet.

Cheers Rene

Hey @reneboer

Thanks for that update, considering the current situation, do you foresee any reason why the following wouldn’t work and/or cause an issue ? (Just copy the latest version over from one location, so they are all the same ?)

cp /rom/usr/lib/lua/ssl/https.lua /mios/usr/lib/lua/ssl/

Well, make sure you make a copy the version in /mios/lib first. Then overwrite, reboot and see what happens. Just make sure you have a path back.

Cheers Rene