diff options
| author | mpeterv <mpeterval@gmail.com> | 2015-06-26 14:46:05 +0300 |
|---|---|---|
| committer | mpeterv <mpeterval@gmail.com> | 2015-06-26 14:57:50 +0300 |
| commit | 4c7a5bc9914b1dada3616057cd9b7b214200efe7 (patch) | |
| tree | 9cd9daf5de1a672198029117a9eed6bd1e33c891 /src | |
| parent | e1badc44a12e99ffb4820bf216f1e9cc36dbf88a (diff) | |
| download | luarocks-4c7a5bc9914b1dada3616057cd9b7b214200efe7.tar.gz luarocks-4c7a5bc9914b1dada3616057cd9b7b214200efe7.tar.bz2 luarocks-4c7a5bc9914b1dada3616057cd9b7b214200efe7.zip | |
Add '--rockspec-format' option for write_rockspec command
'--rockspec-format' option allows selecting rockspec format version when
writing a rockspec.
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/util.lua | 1 | ||||
| -rw-r--r-- | src/luarocks/write_rockspec.lua | 26 |
2 files changed, 15 insertions, 12 deletions
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 6fecf863..c06c8354 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua | |||
| @@ -118,6 +118,7 @@ local supported_flags = { | |||
| 118 | ["rock-tree"] = true, | 118 | ["rock-tree"] = true, |
| 119 | ["rock-trees"] = true, | 119 | ["rock-trees"] = true, |
| 120 | ["rockspec"] = true, | 120 | ["rockspec"] = true, |
| 121 | ["rockspec-format"] = "<ver>", | ||
| 121 | ["server"] = "<server>", | 122 | ["server"] = "<server>", |
| 122 | ["skip-pack"] = true, | 123 | ["skip-pack"] = true, |
| 123 | ["source"] = true, | 124 | ["source"] = true, |
diff --git a/src/luarocks/write_rockspec.lua b/src/luarocks/write_rockspec.lua index 68942e07..972562c3 100644 --- a/src/luarocks/write_rockspec.lua +++ b/src/luarocks/write_rockspec.lua | |||
| @@ -24,18 +24,19 @@ If a repository URL is given with no version, it creates an 'scm' rock. | |||
| 24 | Note that the generated file is a _starting point_ for writing a | 24 | Note that the generated file is a _starting point_ for writing a |
| 25 | rockspec, and is not guaranteed to be complete or correct. | 25 | rockspec, and is not guaranteed to be complete or correct. |
| 26 | 26 | ||
| 27 | --output=<file> Write the rockspec with the given filename. | 27 | --output=<file> Write the rockspec with the given filename. |
| 28 | If not given, a file is written in the current | 28 | If not given, a file is written in the current |
| 29 | directory with a filename based on given name and version. | 29 | directory with a filename based on given name and version. |
| 30 | --license="<string>" A license string, such as "MIT/X11" or "GNU GPL v3". | 30 | --license="<string>" A license string, such as "MIT/X11" or "GNU GPL v3". |
| 31 | --summary="<txt>" A short one-line description summary. | 31 | --summary="<txt>" A short one-line description summary. |
| 32 | --detailed="<txt>" A longer description string. | 32 | --detailed="<txt>" A longer description string. |
| 33 | --homepage=<url> Project homepage. | 33 | --homepage=<url> Project homepage. |
| 34 | --lua-version=<ver> Supported Lua versions. Accepted values are "5.1", "5.2", | 34 | --lua-version=<ver> Supported Lua versions. Accepted values are "5.1", "5.2", |
| 35 | "5.3", "5.1,5.2", "5.2,5.3", or "5.1,5.2,5.3". | 35 | "5.3", "5.1,5.2", "5.2,5.3", or "5.1,5.2,5.3". |
| 36 | --tag=<tag> Tag to use. Will attempt to extract version number from it. | 36 | --rockspec-format=<ver> Rockspec format version, such as "1.0" or "1.1". |
| 37 | --lib=<lib>[,<lib>] A comma-separated list of libraries that C files need to | 37 | --tag=<tag> Tag to use. Will attempt to extract version number from it. |
| 38 | link to. | 38 | --lib=<lib>[,<lib>] A comma-separated list of libraries that C files need to |
| 39 | link to. | ||
| 39 | ]] | 40 | ]] |
| 40 | 41 | ||
| 41 | local function open_file(name) | 42 | local function open_file(name) |
| @@ -246,6 +247,7 @@ function write_rockspec.run(...) | |||
| 246 | end | 247 | end |
| 247 | 248 | ||
| 248 | local rockspec = { | 249 | local rockspec = { |
| 250 | rockspec_format = flags["rockspec-format"], | ||
| 249 | package = name, | 251 | package = name, |
| 250 | name = name:lower(), | 252 | name = name:lower(), |
| 251 | version = version.."-1", | 253 | version = version.."-1", |
