lua-users home
lua-l archive

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


On Fri, Nov 4, 2016 at 7:34 PM, sur-behoffski
<sur_behoffski@grouse.com.au> wrote:
> 1. Given that I have some set of LuaRocks installed, is there an
>    automated way of checking whether the main repository has a newer
>    version?  I haven't seen an easy way to do this from the
>    intrinsic help contained within the "luarocks" command; and

There is no fully automated way right now.
However, you can run `luarocks list --outdated`
to list outdated rocks. Using `--porcelain` for machine-friendly output
something like this can be an automated way to upgrade all rocks:

luarocks list --outdated --porcelain | \
    while read rock cur_version new_version; do \
        luarocks show $rock $new_version >/dev/null 2>&1 || \
            luarocks install $rock $new_version; done

(The `luarocks show` bit checks if an outdated rock on the list
isn't already installed, which may happen if it's a dependency
of another outdated rock that came first in the list.)

-- Best regards,
-- Peter Melnichenko