lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 27 March 2013 10:38, steve donovan <steve.j.donovan@gmail.com> wrote:
On Wed, Mar 27, 2013 at 12:22 PM, Laurent Faillie <l_faillie@yahoo.com> wrote:
> Related to this announcement, I wonder if there is a way to check
> automatically if installed rocks need to be updated ?

Would be easy enough to automate for a _given_ rock.  First find out
current version:

~/lua/rockspec/examples$ luarocks list luafilesystem
Installed rocks:
----------------
luafilesystem
   1.5.0-1 (installed) - /home/azisa/.luarocks/lib/luarocks/rocks
   1.5.0-1 (installed) - /usr/local/lib/luarocks/rocks

then search the repo

~/lua/rockspec/examples$ luarocks search luafilesystem
Search results:
===============
Rockspecs and source rocks:
---------------------------
luafilesystem
   1.5.0-1 (src) - http://146.64.150.244/rocks
   1.5.0-1 (rockspec) - http://146.64.150.244/rocks
   1.4.2-1 (rockspec) - http://146.64.150.244/rocks
   1.4.2-1 (src) - http://146.64.150.244/rocks
   1.4.1-1 (src) - http://146.64.150.244/rocks
   1.4.1-1 (rockspec) - http://146.64.150.244/rocks
   1.4.0-2 (rockspec) - http://146.64.150.244/rocks

So in this case, no need to update.

Generally, it could be done with a plain 'list' and a 'search --all'
and a little Lua script...

steve d.


How about luarocks adds two commands:

luarocks installed_version luafilesystem
luarocks latest_version luafilesystem

When building scripts to install dependencies on new machines, I currently have to cobble this sort of thing together on an ad hoc basis.

Incidentally, with the latest penlight installed through luarocks, I get this:
~$  luarocks list penlight

Installed rocks:
----------------

penlight
   scm-1 (installed) - /usr/local/lib/luarocks/rocks

which makes parsing the version a little tricky.