-local function _uvl_validate_section(node, name)
- local co = node.map:get()
-
- luci.uvl.STRICT_UNKNOWN_OPTIONS = false
- luci.uvl.STRICT_UNKNOWN_SECTIONS = false
-
- local function tag_fields(e)
- if e.option and node.fields[e.option] then
- if node.fields[e.option].error then
- node.fields[e.option].error[name] = e
- else
- node.fields[e.option].error = { [name] = e }
- end
- elseif e.childs then
- for _, c in ipairs(e.childs) do tag_fields(c) end
- end
- end
-
- local function tag_section(e)
- local s = { }
- for _, c in ipairs(e.childs or { e }) do
- if c.childs and not c:is(luci.uvl.errors.ERR_DEPENDENCY) then
- table.insert( s, c.childs[1]:string() )
- else
- table.insert( s, c:string() )
- end
- end
- if #s > 0 then
- if node.error then
- node.error[name] = s
- else
- node.error = { [name] = s }
- end
- end
- end
-
- local stat, err = node.map.validator:validate_section(node.config, name, co)
- if err then
- node.map.save = false
- tag_fields(err)
- tag_section(err)
- end
-
-end
-
-local function _uvl_strip_remote_dependencies(deps)
- local clean = {}
-
- for k, v in pairs(deps) do
- k = k:gsub("%$config%.%$section%.", "")
- if k:match("^[%w_]+$") and type(v) == "string" then
- clean[k] = v
- end
- end
-
- return clean
-end
-