* luci/libs: uvl: implement package sections in the uvl scheme format
This commit is contained in:
parent
eb279ab360
commit
51bfdb1377
2 changed files with 23 additions and 0 deletions
|
@ -419,6 +419,26 @@ function UVL._read_scheme_parts( self, scheme, schemes )
|
||||||
|
|
||||||
local ok, err
|
local ok, err
|
||||||
|
|
||||||
|
-- Step 0: get package meta information
|
||||||
|
for i, conf in ipairs( schemes ) do
|
||||||
|
for k, v in pairs( conf ) do
|
||||||
|
if v['.type'] == 'package' then
|
||||||
|
self.packages[scheme:sid()] =
|
||||||
|
self.packages[scheme:sid()] or {
|
||||||
|
["name"] = scheme:sid();
|
||||||
|
["sections"] = { };
|
||||||
|
["variables"] = { };
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, v2 in pairs(v) do
|
||||||
|
if k == "title" or k == "description" then
|
||||||
|
self.packages[scheme:sid()][k] = v2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Step 1: get all sections
|
-- Step 1: get all sections
|
||||||
for i, conf in ipairs( schemes ) do
|
for i, conf in ipairs( schemes ) do
|
||||||
for k, v in pairs( conf ) do
|
for k, v in pairs( conf ) do
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package network
|
package network
|
||||||
|
|
||||||
|
config package
|
||||||
|
option title 'Network Configuration'
|
||||||
|
|
||||||
config section
|
config section
|
||||||
option name 'interface'
|
option name 'interface'
|
||||||
option title 'Network interface definition'
|
option title 'Network interface definition'
|
||||||
|
|
Loading…
Reference in a new issue