summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-09-02 20:24:06 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-09-02 20:24:06 +0000
commit51bfdb1377c91b0947ae10025d6b6261c34de721 (patch)
tree653f9305ceaac572cdb00aafa569589c7aed10dd
parenteb279ab36033c887e482eb3395892deb182a335a (diff)
* luci/libs: uvl: implement package sections in the uvl scheme format
-rw-r--r--libs/uvl/luasrc/uvl.lua20
-rw-r--r--libs/uvl/root/lib/uci/schema/default/network3
2 files changed, 23 insertions, 0 deletions
diff --git a/libs/uvl/luasrc/uvl.lua b/libs/uvl/luasrc/uvl.lua
index 082302837..7fb11b12f 100644
--- a/libs/uvl/luasrc/uvl.lua
+++ b/libs/uvl/luasrc/uvl.lua
@@ -419,6 +419,26 @@ function UVL._read_scheme_parts( self, scheme, schemes )
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
for i, conf in ipairs( schemes ) do
for k, v in pairs( conf ) do
diff --git a/libs/uvl/root/lib/uci/schema/default/network b/libs/uvl/root/lib/uci/schema/default/network
index 85da7e301..df9fc0e5e 100644
--- a/libs/uvl/root/lib/uci/schema/default/network
+++ b/libs/uvl/root/lib/uci/schema/default/network
@@ -1,5 +1,8 @@
package network
+config package
+ option title 'Network Configuration'
+
config section
option name 'interface'
option title 'Network interface definition'