LuaDist: Use

drahosp edited this page Aug 25, 2012 · 11 revisions

Commandline interface.

LuaDist deployment utility itself is implemented as Lua package with a simple API. For convenience a commandline interface is provided. By calling the ./bin/luadist script without arguments the following default printout should help you understand basic functionality provided:

> luadist
LuaDist-git 0.1.13 - Lua package manager for the LuaDist deployment system.
Released under the MIT License. See https://github.com/luadist/luadist-git

Usage: luadist [DEPLOYMENT_DIRECTORY] <COMMAND> [ARGUMENTS...] [-VARIABLES...]

    Commands:

        help      - print this help
        install   - install modules
        remove    - remove modules
        refresh   - update information about modules in repositories
        list      - list installed modules
        info      - show information about modules
        search    - search repositories for modules
        fetch     - download modules
        make      - manually deploy modules from local paths
        selftest  - run the selftest of LuaDist

    To get help on specific command, run:

        luadist help <COMMAND>

Installing a dist.

One of the most basic operations in LuaDist is to install a dist. LuaDist was designed to deploy applications into multiple directories so the first expected argument is a path LuaDist will operate on. This [DEPLOYMENT_DIRECTORY] can be existing LuaDist deployment or a new desired deployment directory. When this argument is omitted LuaDist will use deployment directory it resides in.

For example to install md5 into LuaDist you can simply use:

> luadist install md5

If you would like to install md5 and luasocket into a separate directory with all its dependencies with verbose output then use:

> luadist /path/to/install install md5 luasocket -verbose

Restricting the version you desire to install can be achieved by extending the argument as follows. Additionally you can install multiple dists at the same time.

> luadist /path/to/my/lua/5.2 install lua-5.2 luasocket

Alternatively you can use logical constraints on the version to be installed.

> luadist install "luafilesystem<1.5"

Searching for dists.

Similarly to the install command searching for available dists uses almost exactly the same syntax.

For example we can list all available modules and then search for any dists that contain jit in their name.

> luadist search
> luadist search jit

Listing dist information.

Using the info command additional information about deployed and available dists can be obtained.

> luadist info lua

This will display detailed information about the dist such as: maintainers, authors, source location, dependencies, description etc.

Removing dists.

Removing an installed dist is done using the remove command. Note that doing this may break dependencies. LuaDist also supports component based installation. This means that files in any dist are marked as one of the following: Runtime, Library, Header, Data, Documentation, Test, Example, Other and Unspecified. You can remove any components as needed eg.

> luadist remove -components=Documentation,Test
> luadist remove lua -components=Documentation
> luadist remove md5

Please note that Library and Header components are required for source based installations of LuaDist and removing them will cause build failures when installing dists that depend on the files. You can however freely remove components from binary deployments or deployments that you do not plan to install other modules into. Removing Runtime component of any package will also remove it from the dependency tree.

Additional arguments.

The command line utility accepts additional arguments such as -verbose or -debug. These arguments override default values of LuaDist configuration and any configuration value can be changed.

Additionally any CMake arguments can be provided when building source dists. The syntax is to prefix any variable you wish to modify with -D. For example -DCMAKE_BUILD_TYPE=Release can be used to force CMake to build release version of the dist.