aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-07-01 16:54:25 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-07-01 22:54:08 -0300
commit0728077cb0254bf2cb8cfc920a20f184a1a73fde (patch)
treec165be0802ec2ea0a31a3fee719ece583f5701c3 /src
parentcba926d01b56f88266e7eefff9b58fc4562bbdfb (diff)
downloadluarocks-0728077cb0254bf2cb8cfc920a20f184a1a73fde.tar.gz
luarocks-0728077cb0254bf2cb8cfc920a20f184a1a73fde.tar.bz2
luarocks-0728077cb0254bf2cb8cfc920a20f184a1a73fde.zip
manifest: add 'namespace' to the type checker
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/type/manifest.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/luarocks/type/manifest.lua b/src/luarocks/type/manifest.lua
index 407428b2..bf985ad3 100644
--- a/src/luarocks/type/manifest.lua
+++ b/src/luarocks/type/manifest.lua
@@ -3,7 +3,7 @@ local type_manifest = {}
3local type_check = require("luarocks.type_check") 3local type_check = require("luarocks.type_check")
4 4
5local manifest_formats = type_check.declare_schemas({ 5local manifest_formats = type_check.declare_schemas({
6 ["1.0"] = { 6 ["3.0"] = {
7 repository = { 7 repository = {
8 _mandatory = true, 8 _mandatory = true,
9 -- packages 9 -- packages
@@ -45,6 +45,7 @@ local manifest_formats = type_check.declare_schemas({
45 -- each dependency 45 -- each dependency
46 _any = { 46 _any = {
47 name = { _type = "string" }, 47 name = { _type = "string" },
48 namespace = { _type = "string" },
48 constraints = { 49 constraints = {
49 _any = { 50 _any = {
50 no_upgrade = { _type = "boolean" }, 51 no_upgrade = { _type = "boolean" },
@@ -70,10 +71,10 @@ local manifest_formats = type_check.declare_schemas({
70-- succeeded, or nil and an error message if it failed. 71-- succeeded, or nil and an error message if it failed.
71function type_manifest.check(manifest, globals) 72function type_manifest.check(manifest, globals)
72 assert(type(manifest) == "table") 73 assert(type(manifest) == "table")
73 local format = manifest_formats["1.0"] 74 local format = manifest_formats["3.0"]
74 local ok, err = type_check.check_undeclared_globals(globals, format) 75 local ok, err = type_check.check_undeclared_globals(globals, format)
75 if not ok then return nil, err end 76 if not ok then return nil, err end
76 return type_check.type_check_table("1.0", manifest, format, "") 77 return type_check.type_check_table("3.0", manifest, format, "")
77end 78end
78 79
79return type_manifest 80return type_manifest