diff options
| author | V1K1NGbg <victor@ilchev.com> | 2024-08-06 22:27:09 +0300 |
|---|---|---|
| committer | V1K1NGbg <victor@ilchev.com> | 2024-08-06 22:27:09 +0300 |
| commit | da549a072e8288dd5822a9c6ea747c3250ef17c7 (patch) | |
| tree | 03e4c73c898bcd34920aa6dba2ffaaf2acecf57d /src | |
| parent | 9bc589914dddd1ad393e20a024ca604a4a75a485 (diff) | |
| download | luarocks-da549a072e8288dd5822a9c6ea747c3250ef17c7.tar.gz luarocks-da549a072e8288dd5822a9c6ea747c3250ef17c7.tar.bz2 luarocks-da549a072e8288dd5822a9c6ea747c3250ef17c7.zip | |
rockspec lua gen
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/core/types/rockspec.lua | 12 | ||||
| -rw-r--r-- | src/luarocks/rockspecs.lua | 13 |
2 files changed, 8 insertions, 17 deletions
diff --git a/src/luarocks/core/types/rockspec.lua b/src/luarocks/core/types/rockspec.lua index 222887e9..6acd4b64 100644 --- a/src/luarocks/core/types/rockspec.lua +++ b/src/luarocks/core/types/rockspec.lua | |||
| @@ -1,17 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | local rockspec = {Description = {}, Variables = {}, Source = {}, Test = {}, Install = {}, Build = {}, Dependencies = {}, BuildDependencies = {}, ExternalDependencies = {}, TestDependencies = {}, Hooks = {}, Deploy = {}, Rockspec = {}, } | 4 | local rockspec = {Description = {}, Variables = {}, Source = {}, Test = {}, Install = {}, Build = {}, Dependencies = {}, ExternalDependencies = {}, Hooks = {}, Deploy = {}, Rockspec = {}, } |
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | |||
| 9 | |||
| 10 | |||
| 11 | |||
| 12 | |||
| 13 | |||
| 14 | |||
| 15 | 5 | ||
| 16 | 6 | ||
| 17 | 7 | ||
diff --git a/src/luarocks/rockspecs.lua b/src/luarocks/rockspecs.lua index a39c39d9..337de233 100644 --- a/src/luarocks/rockspecs.lua +++ b/src/luarocks/rockspecs.lua | |||
| @@ -17,6 +17,7 @@ local rock = require("luarocks.core.types.rockspec") | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | |||
| 20 | local vendored_build_type_set = { | 21 | local vendored_build_type_set = { |
| 21 | ["builtin"] = true, | 22 | ["builtin"] = true, |
| 22 | ["cmake"] = true, | 23 | ["cmake"] = true, |
| @@ -66,7 +67,7 @@ end | |||
| 66 | 67 | ||
| 67 | local function convert_dependencies(dependencies) | 68 | local function convert_dependencies(dependencies) |
| 68 | if not dependencies then | 69 | if not dependencies then |
| 69 | return {} | 70 | return true |
| 70 | end | 71 | end |
| 71 | local qs = {} | 72 | local qs = {} |
| 72 | for i = 1, #dependencies do | 73 | for i = 1, #dependencies do |
| @@ -76,7 +77,8 @@ local function convert_dependencies(dependencies) | |||
| 76 | end | 77 | end |
| 77 | qs[i] = parsed | 78 | qs[i] = parsed |
| 78 | end | 79 | end |
| 79 | return qs | 80 | dependencies.queries = qs |
| 81 | return true | ||
| 80 | end | 82 | end |
| 81 | 83 | ||
| 82 | 84 | ||
| @@ -151,18 +153,17 @@ function rockspecs.from_persisted_table(filename, rockspec, globals, quick) | |||
| 151 | 153 | ||
| 152 | rockspec.rocks_provided = util.get_rocks_provided(rockspec) | 154 | rockspec.rocks_provided = util.get_rocks_provided(rockspec) |
| 153 | 155 | ||
| 154 | local err | 156 | local ok, err = convert_dependencies(rockspec.dependencies) |
| 155 | rockspec.dependencies.queries, err = convert_dependencies(rockspec.dependencies) | ||
| 156 | if err then | 157 | if err then |
| 157 | return nil, err | 158 | return nil, err |
| 158 | end | 159 | end |
| 159 | 160 | ||
| 160 | rockspec.build_dependencies.queries, err = convert_dependencies(rockspec.build_dependencies) | 161 | ok, err = convert_dependencies(rockspec.build_dependencies) |
| 161 | if err then | 162 | if err then |
| 162 | return nil, err | 163 | return nil, err |
| 163 | end | 164 | end |
| 164 | 165 | ||
| 165 | rockspec.test_dependencies.queries, err = convert_dependencies(rockspec.test_dependencies) | 166 | ok, err = convert_dependencies(rockspec.test_dependencies) |
| 166 | if err then | 167 | if err then |
| 167 | return nil, err | 168 | return nil, err |
| 168 | end | 169 | end |
