A simple but powerful package manager for the ULua distribution.
local pkg = require 'pkg'
pkg.available() -- List all available packages.
pkg.available('?penlight') -- List available packages matching in name or description 'penlight'.
pkg.available('pl') -- Detailed info about Penlight.
pkg.add('pl') -- Install Penlight and its dependencies.
pkg.remove('pl') -- Remove Penlight and all packages that depend on it.
pkg.update() -- Update all packages.
The behavior of PKG is configured by setting the following keys in ulua/host/config.lua
:
proxy = 'address of web proxy server'
proxyauth = 'username and password of web proxy server as user:password'
noconfirm = 'true if confirmation should be skipped when adding, removing or updating packages'
silent = 'true if no information should be printed when adding, removing or updating packages'
An helper command is available as ulua/bin/upkg
which replicates the functionality available in the PKG package. To avoid clashes with the shell, searches
are performed by adding the -s
flag (instead of adding '?'
in front of name
).
upkg command [-s] [name] [version]
command : one of "status", "available", "add", "remove", "update"
-s : enable searching (only for "status" and "available" commands)
name : package name
version : package version
Returns the loaded module (no global variable is set).
If no argument is passed, information is displayed about all available packages. If a string which begins with '?'
is passed, information is displayed
about all packages matching (description included) the remaining part of the string. Otherwise detailed information is displayed about the package str
.
Same behavior as pkg.available()
for packages which are currently installed (instead of packages which are available to be installed).
Installs package name
and all the required dependencies. If version
is not passed, the latest stable version is selected. Otherwise the most
recent version which have equal major component and that satisfies the remaining components is selected.
Removes package name
and all the packages which depends on it. If version
is not passed, the latest stable version is selected. Otherwise the
most recent version which have equal major component and that satisfies the remaining components is selected.
Updates all packages to the latest available version.