* luci/libs: uvl: implement package sections in the uvl scheme format
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 2 Sep 2008 20:24:06 +0000 (20:24 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 2 Sep 2008 20:24:06 +0000 (20:24 +0000)
libs/uvl/luasrc/uvl.lua
libs/uvl/root/lib/uci/schema/default/network

index 0823028376fb4cacf111a31fc16255e7678b51da..7fb11b12f21b7a6598a70b2ddf4e3c427b445e0a 100644 (file)
@@ -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
index 85da7e301ae0b98011ae3506b3787820aa3c0c4c..df9fc0e5e7bcb1d8e856b81b480fb4f7b0da7b6f 100644 (file)
@@ -1,5 +1,8 @@
 package network
 
+config package
+       option title    'Network Configuration'
+
 config section
        option name     'interface'
        option title    'Network interface definition'