Module luarocks.unpack
Module implementing the LuaRocks "unpack" command. Unpack the contents of a rock.
Functions
run (..., name, version) | Driver function for the "unpack" command. |
run_unpacker (file) | Create a directory and perform the necessary actions so that the sources for the rock and its rockspec are unpacked inside it, laid out properly so that the 'make' command is able to build the module. |
unpack_rock (rock_file, dir_name, kind) | Load a .rock file to the given directory and unpack it inside it. |
unpack_rockspec (rockspec_file, dir_name) | Load a rockspec file to the given directory, fetches the source files specified in the rockspec, and unpack them inside the directory. |
Functions
- run (..., name, version)
-
Driver function for the "unpack" command.
Parameters
- ...:
- name: string: may be a rock filename, for unpacking a rock file or the name of a rock to be fetched and unpacked.
- version: string or nil: if the name of a package is given, a version may also be passed.
Return value:
boolean or (nil, string): true if successful or nil followed by an error message. - run_unpacker (file)
-
Create a directory and perform the necessary actions so that the sources for the rock and its rockspec are unpacked inside it, laid out properly so that the 'make' command is able to build the module.
Parameters
- file: string: A rockspec or .rock URL.
Return value:
boolean or (nil, string): true if successful or nil followed by an error message. - unpack_rock (rock_file, dir_name, kind)
-
Load a .rock file to the given directory and unpack it inside it.
Parameters
- rock_file: string: The URL for a .rock file.
- dir_name: string: The directory where to unpack.
- kind:
Return value:
table or (nil, string): the loaded rockspec table or nil and an error message. - unpack_rockspec (rockspec_file, dir_name)
-
Load a rockspec file to the given directory, fetches the source files specified in the rockspec, and unpack them inside the directory.
Parameters
- rockspec_file: string: The URL for a rockspec file.
- dir_name: string: The directory where to store and unpack files.
Return value:
table or (nil, string): the loaded rockspec table or nil and an error message.