From 310ca38b5fa354bdea4f0a1d2a74791d06de2172 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 16 Sep 2011 14:08:53 -0300 Subject: Added a config flag so that unknown fields are accepted. Closes #19. --- src/luarocks/cfg.lua | 5 +++++ src/luarocks/type_check.lua | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 2b48d576..d2858cca 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua @@ -129,6 +129,11 @@ end local root = rocks_trees[#rocks_trees] local defaults = { + + local_by_default = false, + use_extensions = false, + accept_unknown_fields = false, + lua_modules_path = "/share/lua/5.1/", lib_modules_path = "/lib/lua/5.1/", diff --git a/src/luarocks/type_check.lua b/src/luarocks/type_check.lua index 4c554809..fea25973 100644 --- a/src/luarocks/type_check.lua +++ b/src/luarocks/type_check.lua @@ -209,7 +209,9 @@ type_check_table = function(tbl, types, context) elseif types.MORE then -- Accept unknown field else - return nil, "Unknown field "..k + if not cfg.accept_unknown_fields then + return nil, "Unknown field "..k + end end end for k, v in pairs(types) do -- cgit v1.2.3-55-g6feb