Replace luci-lib-jsonc with our own lua-jsonc

This commit is contained in:
Matthias Schiffer 2018-01-18 13:17:34 +01:00
parent 4d7740ae97
commit 6cf88c3b03
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
5 changed files with 6 additions and 23 deletions

View File

@ -16,7 +16,7 @@ define Package/gluon-core
CATEGORY:=Gluon
TITLE:=Base files of Gluon
DEPENDS:= \
+gluon-site +libgluonutil +lua-platform-info +lua-simple-uci +lua-hash +luci-lib-jsonc +luci-lib-nixio \
+gluon-site +libgluonutil +lua-platform-info +lua-simple-uci +lua-hash +lua-jsonc +luci-lib-nixio \
+vxlan +odhcp6c +firewall +pretty-hostname
endef

View File

@ -1,22 +1,5 @@
local site = (function()
local config = '/lib/gluon/site.json'
local json = require 'luci.jsonc'
local decoder = json.new()
local sink = decoder:sink()
local file = assert(io.open(config))
while true do
local chunk = file:read(2048)
if not chunk or chunk:len() == 0 then break end
sink(chunk)
end
file:close()
return assert(decoder:get())
end)()
local json = require 'jsonc'
local site = assert(json.load('/lib/gluon/site.json'))
local wrap

View File

@ -1,7 +1,7 @@
#!/usr/bin/lua
util = require 'gluon.util'
fs = require 'nixio.fs'
json = require 'luci.jsonc'
json = require 'jsonc'
ubus = require 'ubus'
io.write("Access-Control-Allow-Origin: *\n")

View File

@ -16,7 +16,7 @@ define Package/gluon-web
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Minimal Lua web framework derived from LuCI
DEPENDS:=+luci-lib-jsonc +luci-lib-nixio
DEPENDS:=+lua-jsonc +luci-lib-nixio
endef
define lang-config

View File

@ -4,7 +4,7 @@
-- Licensed to the public under the Apache License 2.0.
local fs = require "nixio.fs"
local json = require "luci.jsonc"
local json = require "jsonc"
local tpl = require "gluon.web.template"
local util = require "gluon.web.util"
local proto = require "gluon.web.http.protocol"