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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
darkbit
ffbs-gluon
Commits
fe521db4
Commit
fe521db4
authored
5 years ago
by
bobcanthelpyou
Committed by
Matthias Schiffer
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
build: add site check for obsolete settings (#1702)
parent
e81d1a39
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
package/gluon-autoupdater/check_site.lua
+1
-0
1 addition, 0 deletions
package/gluon-autoupdater/check_site.lua
package/gluon-core/check_site.lua
+1
-0
1 addition, 0 deletions
package/gluon-core/check_site.lua
scripts/check_site.lua
+24
-8
24 additions, 8 deletions
scripts/check_site.lua
with
26 additions
and
8 deletions
package/gluon-autoupdater/check_site.lua
+
1
−
0
View file @
fe521db4
...
...
@@ -7,4 +7,5 @@ need_table({'autoupdater', 'branches'}, function(branch)
need_string_array_match
(
extend
(
branch
,
{
'mirrors'
}),
'^http://'
)
need_number
(
in_site
(
extend
(
branch
,
{
'good_signatures'
})))
need_string_array_match
(
in_site
(
extend
(
branch
,
{
'pubkeys'
})),
'^%x+$'
)
obsolete
(
in_site
(
extend
(
branch
,
{
'probability'
})),
'Use GLUON_PRIORITY in site.mk instead.'
)
end
)
This diff is collapsed.
Click to expand it.
package/gluon-core/check_site.lua
+
1
−
0
View file @
fe521db4
...
...
@@ -15,6 +15,7 @@ end
need_string_match
(
in_domain
({
'domain_seed'
}),
'^'
..
(
'%x'
):
rep
(
64
)
..
'$'
)
need_string
({
'opkg'
,
'openwrt'
},
false
)
obsolete
({
'opkg'
,
'lede'
},
'Use opkg.openwrt instead.'
)
need_table
({
'opkg'
,
'extra'
},
function
(
extra_repo
)
need_alphanumeric_key
(
extra_repo
)
need_string
(
extra_repo
)
...
...
This diff is collapsed.
Click to expand it.
scripts/check_site.lua
+
24
−
8
View file @
fe521db4
...
...
@@ -4,7 +4,6 @@ local function config_error(src, ...)
error
(
src
..
' error: '
..
string.format
(
...
),
0
)
end
local
has_domains
=
(
os.execute
(
'ls -d "$IPKG_INSTROOT"/lib/gluon/domains/ >/dev/null 2>&1'
)
==
0
)
...
...
@@ -89,11 +88,7 @@ local function domain_src()
return
'domains/'
..
domain_code
..
'.conf'
end
local
function
var_error
(
path
,
val
,
msg
)
if
type
(
val
)
==
'string'
then
val
=
string.format
(
'%q'
,
val
)
end
local
function
conf_src
(
path
)
local
src
if
has_domains
then
...
...
@@ -108,15 +103,22 @@ local function var_error(path, val, msg)
src
=
site_src
()
end
return
src
end
local
function
var_error
(
path
,
val
,
msg
)
if
type
(
val
)
==
'string'
then
val
=
string.format
(
'%q'
,
val
)
end
local
found
=
'unset'
if
val
~=
nil
then
found
=
string.format
(
'%s (a %s value)'
,
tostring
(
val
),
type
(
val
))
end
config_error
(
src
,
'expected %s to %s, but it is %s'
,
path_to_string
(
path
),
msg
,
found
)
config_error
(
conf_src
(
path
)
,
'expected %s to %s, but it is %s'
,
path_to_string
(
path
),
msg
,
found
)
end
function
in_site
(
path
)
if
has_domains
and
loadpath
(
nil
,
domain
,
unpack
(
path
))
~=
nil
then
config_error
(
domain_src
(),
'%s is allowed in site configuration only'
,
path_to_string
(
path
))
...
...
@@ -315,6 +317,20 @@ function need_domain_name(path)
end
,
nil
,
'be a valid domain name'
)
end
function
obsolete
(
path
,
msg
)
local
val
=
loadvar
(
path
)
if
val
==
nil
then
return
nil
end
if
not
msg
then
msg
=
'Check the release notes and documentation for details.'
end
config_error
(
conf_src
(
path
),
'%s is obsolete. %s'
,
path_to_string
(
path
),
msg
)
end
local
check
=
assert
(
loadfile
())
site
=
load_json
(
os.getenv
(
'IPKG_INSTROOT'
)
..
'/lib/gluon/site.json'
)
...
...
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