Module luarocks.rep
Functions for managing the repository on disk.
Functions
delete_bin (command) | Delete a command-line item from the bin directory. |
delete_version (name, version) | Delete a package from the local repository. |
get_versions (name) | Get all installed versions of a package. |
install_bins (name, version, single_file) | Install bin entries in the repository bin dir. |
is_binary_rock (name, version) | Check if a rock contains binary parts or if it is pure Lua. |
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_bin (command)
-
Delete a command-line item from the bin directory.
Parameters
- command: string: name of script
- 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. - install_bins (name, version, single_file)
-
Install bin entries in the repository bin dir.
Parameters
- name: string: name of package
- version: string: package version in string format
- single_file: string or nil: optional parameter, indicating the name of a single file to install; if not given, all bin files from the package are installed.
Return value:
boolean or (nil, string): True if succeeded or nil and and error message. - is_binary_rock (name, version)
-
Check if a rock contains binary parts or if it is pure Lua.
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 code, 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.