From 9424177aca293101c7262ddfcbc6a6aecdf6b3c4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 4 May 2011 21:09:04 +0000 Subject: [PATCH] build: uvl is dead, remove it --- build/uvl2cbi.lua | 88 ------------------------------------------------------ build/uvl2i18n.lua | 33 -------------------- build/uvldoc | 24 --------------- 3 files changed, 145 deletions(-) delete mode 100644 build/uvl2cbi.lua delete mode 100755 build/uvl2i18n.lua delete mode 100755 build/uvldoc diff --git a/build/uvl2cbi.lua b/build/uvl2cbi.lua deleted file mode 100644 index 36cf6b736..000000000 --- a/build/uvl2cbi.lua +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/lua ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ -]]-- - -local uvl = require "luci.uvl" -local util = require "luci.util" - -if not arg[1] then - util.perror("Usage %s scheme_name" % arg[0]) - os.exit(1) -end - - - -local scheme, error = uvl.UVL():get_scheme(arg[1]) - -if not scheme then - print( error:string() ) - os.exit(1) -end - - -print('cbimap = Map(%q, %q, %q)\n' - % { scheme.name, scheme.title or scheme.name, scheme.description or "" } ) - - -for sn, sv in util.kspairs(scheme.sections) do - print('%s = cbimap:section(TypedSection, %q, %q, %q)' - % { sn, sn, sv.title or "", sv.description or "" } ) - - if not sv.named then print('%s.anonymous = true' % sn) end - if not sv.unique then print('%s.addremove = true' % sn) end - if sv.dynamic then print('%s.dynamic = true' % sn) end - - if sv.depends then - for _, dep in ipairs(sv.depends) do - print('%s:depends(%s)' % { sn, util.serialize_data(dep) } ) - end - end - - print('') - - for vn, vv in util.kspairs(scheme.variables[sn]) do - if not vv.type or vv.type == "variable" then - print('%s = %s:option(%s, %q, %q, %q)' - % { vn, sn, vv.datatype == "boolean" and "Flag" or "Value", - vn, vv.title or "", vv.description or "" } ) - elseif vv.type == "enum" then - print('%s = %s:option(%s, %q, %q, %q)' - % { vn, sn, vv.multival and "MultiValue" or "ListValue", - vn, vv.title or "", vv.description or "" } ) - - for _, val in ipairs(vv.valuelist or {}) do - print('%s:value(%q, %q)' - % { vn, val.value, val.title or val.value } ) - end - elseif vv.type == "list" or vv.type == "lazylist" then - print('%s = %s:option(DynamicList, %q, %q, %q)' - % { vn, sn, vn, vv.title or "", vv.description or "" } ) - else - print('-- option: type(%s) ?' % { vv.type or "" } ) - end - - if vv.default then print('%s.default = %q' % { vn, vv.default } ) end - if vv.required then print('%s.optional = false' % vn ) end - if not vv.required then print('%s.rmempty = true' % vn ) end - - for _, dep in ipairs(vv.depends or {}) do - print('%s:depends(%s)' % { vn, util.serialize_data(dep) } ) - end - - print('') - end - - print('\nreturn cbimap') -end diff --git a/build/uvl2i18n.lua b/build/uvl2i18n.lua deleted file mode 100755 index ee57c83ea..000000000 --- a/build/uvl2i18n.lua +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/lua --- uvl2i18n.lua - Convert uvl schemes to i18n files --- $Id$ - -require("luci.util") -require("luci.uvl") - -local shm = luci.uvl.UVL():get_scheme(arg[1]) - -for s, o in luci.util.kspairs(shm.sections) do - print( string.format( '%s_%s = %q', shm.name, s:gsub("_",""), o.title or s ) ) - - if o.description and #o.description > 0 then - print( string.format( - '%s_%s_desc = %q', shm.name, s:gsub("_",""), o.description - ) ) - end - - for v, o in luci.util.kspairs(shm.variables[s]) do - print( string.format( - '%s_%s_%s = %q', shm.name, s:gsub("_",""), v:gsub("_",""), o.title or v - ) ) - - if o.description and #o.description > 0 then - print( string.format( - '%s_%s_%s_desc = %q', shm.name, s:gsub("_",""), - v:gsub("_",""), o.description - ) ) - end - end - - print() -end diff --git a/build/uvldoc b/build/uvldoc deleted file mode 100755 index a6e9cc8e6..000000000 --- a/build/uvldoc +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env lua -local fs = require "luci.fs" -local util = require "luci.util" -local uvldoc = require "luci.uvldoc.renderer" - -pcall(function() - require "uci" - require "luci.model.uci".cursor = function(config, save) - return uci.cursor(config or arg[1] .. "/etc/config", save or arg[1] .. "/tmp/.uci") - end -end) - -local schemes = {} -if not arg[4] or #arg[4] == 0 then - for i, name in ipairs(fs.dir(arg[2].."/default/")) do - if name ~= "." and name ~= ".." then - schemes[#schemes+1] = name - end - end -else - schemes = util.split(arg[4], "[,;%s]+", nil, true) -end - -uvldoc.Generator(schemes, arg[3], arg[2]):make() -- 2.11.0