diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2011-09-16 14:08:53 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2011-09-16 14:08:53 -0300 |
commit | 310ca38b5fa354bdea4f0a1d2a74791d06de2172 (patch) | |
tree | fd4ac91719dca85d9c4b3f921e9dbe5f7cfb4648 | |
parent | 82a914d27f8ae81966e2d1b15c922fd0b964e4ed (diff) | |
download | luarocks-310ca38b5fa354bdea4f0a1d2a74791d06de2172.tar.gz luarocks-310ca38b5fa354bdea4f0a1d2a74791d06de2172.tar.bz2 luarocks-310ca38b5fa354bdea4f0a1d2a74791d06de2172.zip |
Added a config flag so that unknown fields are accepted. Closes #19.
-rw-r--r-- | src/luarocks/cfg.lua | 5 | ||||
-rw-r--r-- | src/luarocks/type_check.lua | 4 |
2 files changed, 8 insertions, 1 deletions
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 | |||
129 | 129 | ||
130 | local root = rocks_trees[#rocks_trees] | 130 | local root = rocks_trees[#rocks_trees] |
131 | local defaults = { | 131 | local defaults = { |
132 | |||
133 | local_by_default = false, | ||
134 | use_extensions = false, | ||
135 | accept_unknown_fields = false, | ||
136 | |||
132 | lua_modules_path = "/share/lua/5.1/", | 137 | lua_modules_path = "/share/lua/5.1/", |
133 | lib_modules_path = "/lib/lua/5.1/", | 138 | lib_modules_path = "/lib/lua/5.1/", |
134 | 139 | ||
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) | |||
209 | elseif types.MORE then | 209 | elseif types.MORE then |
210 | -- Accept unknown field | 210 | -- Accept unknown field |
211 | else | 211 | else |
212 | return nil, "Unknown field "..k | 212 | if not cfg.accept_unknown_fields then |
213 | return nil, "Unknown field "..k | ||
214 | end | ||
213 | end | 215 | end |
214 | end | 216 | end |
215 | for k, v in pairs(types) do | 217 | for k, v in pairs(types) do |