Module luarocks.rep

Repository management functions.

Functions

delete_version (name, version) Check if a package exists in a local repository.
get_versions (name) Get all installed versions of a package.
is_installed (name, version) Check if a package exists in a local repository.
package_commands (package, version) Obtain a list of command-line scripts within an installed package.
package_modules (package, version) Obtain a list of modules within an installed package.
wrap_scripts (name, version) Create wrappers to make scripts executable from the command-line.


Functions

delete_version (name, version)
Check if a package exists in a local repository. Version numbers are compared as exact string comparison.

Parameters

  • name: string: name of package
  • version: string: package version in string format
get_versions (name)
Get all installed versions of a package.

Parameters

  • name: string: a package name.

Return value:

table or nil: An array of strings listing installed versions of a package, or nil if none is available.
is_installed (name, version)
Check if a package exists in a local repository. Version numbers are compared as exact string comparison.

Parameters

  • name: string: name of package
  • version: string: package version in string format

Return value:

boolean: true if a package is installed, false otherwise.
package_commands (package, version)
Obtain a list of command-line scripts within an installed package.

Parameters

  • package: string: The package name; for example "luasocket"
  • version: string: The exact version number including revision; for example "2.0.1-1".

Return value:

table: A table of items where keys are command names as strings and values are pathnames in architecture-dependent ".../bin/foo" format. If no modules are found or if package or version are invalid, an empty table is returned.
package_modules (package, version)
Obtain a list of modules within an installed package.

Parameters

  • package: string: The package name; for example "luasocket"
  • version: string: The exact version number including revision; for example "2.0.1-1".

Return value:

table: A table of modules where keys are module identifiers in "foo.bar" format and values are pathnames in architecture-dependent "foo/bar.so" format. If no modules are found or if package or version are invalid, an empty table is returned.
wrap_scripts (name, version)
Create wrappers to make scripts executable from the command-line.

Parameters

  • name: string: name of package
  • version: string: package version in string format

Return value:

boolean or (nil, string): True if succeeded or nil and and error message.

Valid XHTML 1.0!