Module luarocks.rep
Functions for managing the repository on disk.
Functions
delete_version (name, version) | Delete a package from the local repository. |
get_versions (name) | Get all installed versions of a package. |
has_binaries (name, version) | Check if a rock contains binary executables. |
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. |
Functions
- delete_version (name, version)
-
Delete a package from the 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. - has_binaries (name, version)
-
Check if a rock contains binary executables.
Parameters
- name: string: name of an installed rock
- version: string: version of an installed rock
Return value:
boolean: returns true if rock contains platform-specific binary executables, or false if it is a pure-Lua rock. - 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.