summaryrefslogtreecommitdiffhomepage
path: root/libs/uvl/luasrc/uvl.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-09-04 00:56:13 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-09-04 00:56:13 +0000
commit19e22598fd5b43a4e3e23e5e0d5f994281024035 (patch)
treec1aa83ca892d1380d2273f29bda950e865e804ef /libs/uvl/luasrc/uvl.lua
parent34ab619ee3dd9fd04a4198288540e3a7a19aadf6 (diff)
* luci/libs/uvl:
- implement aliasing in luci.uvl.read_scheme() - fixed wrong enum definition in reference scheme - fixed boolean() datatype validator to actually accept "true" and "false" literals - extend uvl cli to validate schemes against the reference scheme (incomplete)
Diffstat (limited to 'libs/uvl/luasrc/uvl.lua')
-rw-r--r--libs/uvl/luasrc/uvl.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/uvl/luasrc/uvl.lua b/libs/uvl/luasrc/uvl.lua
index b1d481062..680581d22 100644
--- a/libs/uvl/luasrc/uvl.lua
+++ b/libs/uvl/luasrc/uvl.lua
@@ -351,7 +351,8 @@ end
-- This is normally done on demand, so you don't have to call this function
-- by yourself.
-- @param scheme Name of the scheme to parse
-function UVL.read_scheme( self, scheme )
+-- @param alias Create an alias for the loaded scheme
+function UVL.read_scheme( self, scheme, alias )
local so = luci.uvl.scheme( self, scheme )
@@ -375,7 +376,9 @@ function UVL.read_scheme( self, scheme )
table.insert( schemes, sd )
end
- return self:_read_scheme_parts( so, schemes )
+ local ok, err = self:_read_scheme_parts( so, schemes )
+ if ok and alias then self.packages[alias] = self.packages[scheme] end
+ return ok, err
else
return false, so:error(ERR.SME_FIND(so, self.schemedir))
end