diff options
| -rw-r--r-- | src/luarocks/rockspecs.lua | 16 | ||||
| -rw-r--r-- | src/luarocks/rockspecs.tl | 16 |
2 files changed, 30 insertions, 2 deletions
diff --git a/src/luarocks/rockspecs.lua b/src/luarocks/rockspecs.lua index 8a1a528e..7f137b87 100644 --- a/src/luarocks/rockspecs.lua +++ b/src/luarocks/rockspecs.lua | |||
| @@ -24,6 +24,19 @@ local vendored_build_type_set = { | |||
| 24 | ["none"] = true, | 24 | ["none"] = true, |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | local rockspec_mt_funcs = {} | ||
| 28 | |||
| 29 | local rockspec_mt = {} | ||
| 30 | rockspec_mt.__index = rockspec_mt_funcs | ||
| 31 | |||
| 32 | function rockspec_mt_funcs.type() | ||
| 33 | util.warning("The function rockspec.type() is no longer " .. | ||
| 34 | "necessary and is now deprecated. Please update your " .. | ||
| 35 | "plugin to remove calls to this function.") | ||
| 36 | |||
| 37 | return "rockspec" | ||
| 38 | end | ||
| 39 | |||
| 27 | 40 | ||
| 28 | 41 | ||
| 29 | 42 | ||
| @@ -181,7 +194,8 @@ function rockspecs.from_persisted_table(filename, rockspec, globals, quick) | |||
| 181 | configure_paths(rockspec) | 194 | configure_paths(rockspec) |
| 182 | end | 195 | end |
| 183 | 196 | ||
| 184 | return rockspec | 197 | |
| 198 | return setmetatable(rockspec, rockspec_mt) | ||
| 185 | end | 199 | end |
| 186 | 200 | ||
| 187 | return rockspecs | 201 | return rockspecs |
diff --git a/src/luarocks/rockspecs.tl b/src/luarocks/rockspecs.tl index 9f12649c..7f31f786 100644 --- a/src/luarocks/rockspecs.tl +++ b/src/luarocks/rockspecs.tl | |||
| @@ -24,6 +24,19 @@ local vendored_build_type_set: {string: boolean} = { | |||
| 24 | ["none"] = true, | 24 | ["none"] = true, |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | local rockspec_mt_funcs = {} | ||
| 28 | |||
| 29 | local rockspec_mt: metatable<Rockspec> = {} | ||
| 30 | rockspec_mt.__index = rockspec_mt_funcs | ||
| 31 | |||
| 32 | function rockspec_mt_funcs.type(): string | ||
| 33 | util.warning("The function rockspec.type() is no longer " .. | ||
| 34 | "necessary and is now deprecated. Please update your " .. | ||
| 35 | "plugin to remove calls to this function.") | ||
| 36 | |||
| 37 | return "rockspec" | ||
| 38 | end | ||
| 39 | |||
| 27 | --- Perform platform-specific overrides on a table. | 40 | --- Perform platform-specific overrides on a table. |
| 28 | -- Overrides values of table with the contents of the appropriate | 41 | -- Overrides values of table with the contents of the appropriate |
| 29 | -- subset of its "platforms" field. The "platforms" field should | 42 | -- subset of its "platforms" field. The "platforms" field should |
| @@ -181,7 +194,8 @@ function rockspecs.from_persisted_table(filename: string, rockspec: Rockspec, gl | |||
| 181 | configure_paths(rockspec) | 194 | configure_paths(rockspec) |
| 182 | end | 195 | end |
| 183 | 196 | ||
| 184 | return rockspec | 197 | -- TODO remove this on LuaRocks 4.0 |
| 198 | return setmetatable(rockspec, rockspec_mt) | ||
| 185 | end | 199 | end |
| 186 | 200 | ||
| 187 | return rockspecs | 201 | return rockspecs |
