diff options
Diffstat (limited to '')
-rw-r--r-- | docs/luarocks_unpack.md | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/docs/luarocks_unpack.md b/docs/luarocks_unpack.md new file mode 100644 index 00000000..4fa8754a --- /dev/null +++ b/docs/luarocks_unpack.md | |||
@@ -0,0 +1,61 @@ | |||
1 | # luarocks unpack | ||
2 | |||
3 | Unpack the contents of a rock. | ||
4 | |||
5 | ## Usage | ||
6 | |||
7 | `luarocks unpack [--force] {<rock> | <rockspec> | <name> [<version>]}` | ||
8 | |||
9 | Unpacks the contents of a rock in a newly created directory under the current | ||
10 | directory. Argument may be a rock file, a rockspec file, or the name of a | ||
11 | rock/rockspec in a remote repository. | ||
12 | |||
13 | If `--force` is passed, files are unpacked even if the output directory | ||
14 | already exists. | ||
15 | |||
16 | When a rock is given, LuaRocks creates a directory and extracts the contents | ||
17 | of a rock inside it. If it is a `.src.rock` file, it also extracts the | ||
18 | sources, and copies the rock's rockspec to the root of the sources directory, | ||
19 | so that you can run [luarocks make](luarocks_make.md). | ||
20 | |||
21 | When a rockspec is given, LuaRocks creates a directory and then fetches and | ||
22 | extracts the sources for the module inside it. It also copies the rockspec to | ||
23 | the root of the sources directory. | ||
24 | |||
25 | When a binary rock is given, it just extracts the contents of the rock in the | ||
26 | created directory for further inspection. To fetch the sources, you can run | ||
27 | `luarocks unpack` again on the rockspec file that will be extracted from the | ||
28 | binary rock. | ||
29 | |||
30 | When a name (and optionally a version) is given, LuaRocks tries to download a | ||
31 | source rock or a rockspec from remote repositories, and then proceeds as if | ||
32 | the obtained file was provided locally. | ||
33 | |||
34 | ## Examples | ||
35 | |||
36 | ``` | ||
37 | luarocks unpack luafilesystem 1.4.0 | ||
38 | ``` | ||
39 | |||
40 | This fetches `luafilesystem-1.4.0-1.src.rock` from the remote repository and | ||
41 | creates in the current directory a directory called `luafilesystem-1.4.0-1` | ||
42 | with the contents of the rock, including the LuaFileSystem sources unpacked. | ||
43 | You will then be able to go into the | ||
44 | `luafilesystem-1.4.0-1/luafilesystem-1.4.0` directory and run [luarocks | ||
45 | make](luarocks_make.md). | ||
46 | |||
47 | ``` | ||
48 | luarocks unpack copas-1.1.1-1.rockspec | ||
49 | ``` | ||
50 | |||
51 | Assuming you have `copas-1.1.1-1.rockspec` in the current directory, this | ||
52 | creates in the current directory a directory called `copas-1.1.1-1` with the | ||
53 | rockspec and the Copas sources unpacked. You will then be able to go into the | ||
54 | `copas-1.1.1-1/copas-1.1.1` directory and run [luarocks | ||
55 | make](luarocks_make.md). | ||
56 | |||
57 | While the extracted directory names may look repetitive, note that the first | ||
58 | directory is a directory in a LuaRocks "name-version-revision" format, and the | ||
59 | second directory is the directory contained inside the sources archives, which | ||
60 | may be in any format, and in some cases may not even exist. | ||
61 | |||