Skip to content
Snippets Groups Projects
Unverified Commit 77502847 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

check_site: move site loading logic to check_site_lib (which is renamed to check_site.lua)

parent 43628c16
No related branches found
No related tags found
No related merge requests found
......@@ -11,13 +11,8 @@ shell-verbatim = $(call shell-unescape,$(call shell-escape,$(1)))
define GluonCheckSite
[ -z "$$IPKG_INSTROOT" ] || "${TOPDIR}/staging_dir/hostpkg/bin/lua" -e 'dofile()' <<'END__GLUON__CHECK__SITE'
local f = assert(io.open(os.getenv('IPKG_INSTROOT') .. '/lib/gluon/site.json'))
local site_json = f:read('*a')
f:close()
site = require('cjson').decode(site_json)
$(call shell-verbatim,cat '$(TOPDIR)/../scripts/check_site_lib.lua' '$(1)')
[ -z "$$IPKG_INSTROOT" ] || "${TOPDIR}/staging_dir/hostpkg/bin/lua" "${TOPDIR}/../scripts/check_site.lua" <<'END__GLUON__CHECK__SITE'
$(call shell-verbatim,cat '$(1)')
END__GLUON__CHECK__SITE
endef
......
local cjson = require 'cjson'
local function load_json(filename)
local f = assert(io.open(filename))
local json = cjson.decode(f:read('*a'))
f:close()
return json
end
local site = load_json(os.getenv('IPKG_INSTROOT') .. '/lib/gluon/site.json')
function in_site(var)
return var
end
......@@ -170,3 +182,6 @@ end
function need_array_of(path, array, required)
return need_array(path, function(e) need_one_of(e, array) end, required)
end
dofile()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment