Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
ffbs-gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ffbs
ffbs-gluon
Commits
8a422ac0
Commit
8a422ac0
authored
3 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
treewide: use lua-jsonc instead of lua-cjson for JSON handling during build
parent
8a41d8d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
package/gluon-site/Makefile
+2
-2
2 additions, 2 deletions
package/gluon-site/Makefile
scripts/check_site.lua
+3
-11
3 additions, 11 deletions
scripts/check_site.lua
scripts/domain_aliases.lua
+2
-9
2 additions, 9 deletions
scripts/domain_aliases.lua
with
7 additions
and
22 deletions
package/gluon-site/Makefile
+
2
−
2
View file @
8a422ac0
...
...
@@ -8,7 +8,7 @@ PKG_VERSION:=$(if $(DUMP),x,$(GLUON_SITE_VERSION))
PKG_CONFIG_DEPENDS
:=
CONFIG_GLUON_RELEASE CONFIG_GLUON_SITEDIR CONFIG_GLUON_MULTIDOMAIN
PKG_FILE_DEPENDS
:=
$(
GLUON_SITEDIR
)
/site.conf
$(
GLUON_SITEDIR
)
/domains/
$(
GLUON_SITEDIR
)
/i18n/
PKG_BUILD_DEPENDS
:=
lua-
c
json/host gluon-web/host
PKG_BUILD_DEPENDS
:=
lua-json
c
/host gluon-web/host
PKG_BUILD_DIR
:=
$(
BUILD_DIR
)
/
$(
PKG_NAME
)
...
...
@@ -38,7 +38,7 @@ endef
define
GenerateJSON
GLUON_SITEDIR
=
'
$$(
GLUON_SITEDIR
)
'
GLUON_SITE_CONFIG
=
'
$(
1
)
.conf'
\
lua
-e
'print(require("
c
json").
encode
(assert(dofile("../../scripts/site_config.lua")(os.getenv("GLUON_SITE_CONFIG")))))'
\
lua
-e
'print(require("json
c
").
stringify
(assert(dofile("../../scripts/site_config.lua")(os.getenv("GLUON_SITE_CONFIG")))))'
\
>
'
$$(
PKG_BUILD_DIR
)
/
$(
1
)
.json'
endef
...
...
This diff is collapsed.
Click to expand it.
scripts/check_site.lua
+
3
−
11
View file @
8a422ac0
local
c
json
=
require
'
c
json'
local
json
=
require
'json
c
'
local
function
config_error
(
src
,
...
)
error
(
src
..
' error: '
..
string.format
(
...
),
0
)
...
...
@@ -7,20 +7,12 @@ end
local
has_domains
=
(
os.execute
(
'ls -d "$IPKG_INSTROOT"/lib/gluon/domains/ >/dev/null 2>&1'
)
==
0
)
local
function
load_json
(
filename
)
local
f
=
assert
(
io.open
(
filename
))
local
json
=
cjson
.
decode
(
f
:
read
(
'*a'
))
f
:
close
()
return
json
end
local
function
get_domains
()
local
domains
=
{}
local
dirs
=
io.popen
(
"find \"
$
IPKG_INSTROOT
\
"/lib/gluon/domains/ -name '*.json'"
)
for
filename
in
dirs
:
lines
()
do
local
name
=
string.match
(
filename
,
'([^/]+).json$'
)
domains
[
name
]
=
load_json
(
filename
)
domains
[
name
]
=
assert
(
json
.
load
(
filename
)
)
end
dirs
:
close
()
...
...
@@ -391,7 +383,7 @@ end
local
check
=
setfenv
(
assert
(
loadfile
()),
M
)
site
=
load_json
(
os.getenv
(
'IPKG_INSTROOT'
)
..
'/lib/gluon/site.json'
)
site
=
assert
(
json
.
load
(
os.getenv
(
'IPKG_INSTROOT'
)
..
'/lib/gluon/site.json'
)
)
local
ok
,
err
=
pcall
(
function
()
if
has_domains
then
...
...
This diff is collapsed.
Click to expand it.
scripts/domain_aliases.lua
+
2
−
9
View file @
8a422ac0
local
c
json
=
require
'
c
json'
local
json
=
require
'json
c
'
local
function
load_json
(
filename
)
local
f
=
assert
(
io.open
(
filename
))
local
json
=
cjson
.
decode
(
f
:
read
(
'*a'
))
f
:
close
()
return
json
end
local
domain
=
load_json
(
arg
[
1
])
local
domain
=
assert
(
json
.
load
(
arg
[
1
]))
for
k
,
_
in
pairs
(
domain
.
domain_names
)
do
print
(
k
)
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment