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

target_lib: replace envtrue with more intuitive istrue helper

parent c9f3017a
No related branches found
No related tags found
No related merge requests found
...@@ -89,13 +89,13 @@ files["targets/*"] = { ...@@ -89,13 +89,13 @@ files["targets/*"] = {
"defaults", "defaults",
"device", "device",
"env", "env",
"envtrue",
"exec", "exec",
"exec_capture", "exec_capture",
"exec_capture_raw", "exec_capture_raw",
"exec_raw", "exec_raw",
"factory_image", "factory_image",
"include", "include",
"istrue",
"no_opkg", "no_opkg",
"packages", "packages",
"sysupgrade_image", "sysupgrade_image",
......
...@@ -15,11 +15,6 @@ local env = setmetatable({}, { ...@@ -15,11 +15,6 @@ local env = setmetatable({}, {
}) })
F.env = env F.env = env
local envtrue = setmetatable({}, {
__index = function(_, k) return (tonumber(os.getenv(k)) or 0) > 0 end
})
F.envtrue = envtrue
assert(env.GLUON_SITEDIR) assert(env.GLUON_SITEDIR)
assert(env.GLUON_TARGETSDIR) assert(env.GLUON_TARGETSDIR)
assert(env.GLUON_RELEASE) assert(env.GLUON_RELEASE)
...@@ -55,8 +50,12 @@ for dev in string.gmatch(env.GLUON_DEVICES or '', '%S+') do ...@@ -55,8 +50,12 @@ for dev in string.gmatch(env.GLUON_DEVICES or '', '%S+') do
unknown_devices[dev] = true unknown_devices[dev] = true
end end
function F.istrue(v)
return (tonumber(v) or 0) > 0
end
local function want_device(dev, options) local function want_device(dev, options)
if options.broken and not envtrue.BROKEN then if options.broken and not F.istrue(env.BROKEN) then
return false return false
end end
if options.deprecated and env.GLUON_DEPRECATED == '0' then if options.deprecated and env.GLUON_DEPRECATED == '0' then
......
...@@ -47,11 +47,11 @@ config '# CONFIG_KERNEL_IPV6_MROUTE is not set' ...@@ -47,11 +47,11 @@ config '# CONFIG_KERNEL_IPV6_MROUTE is not set'
try_config 'CONFIG_TARGET_MULTI_PROFILE=y' try_config 'CONFIG_TARGET_MULTI_PROFILE=y'
try_config 'CONFIG_TARGET_PER_DEVICE_ROOTFS=y' try_config 'CONFIG_TARGET_PER_DEVICE_ROOTFS=y'
if envtrue.GLUON_MULTIDOMAIN then if istrue(env.GLUON_MULTIDOMAIN) then
config 'CONFIG_GLUON_MULTIDOMAIN=y' config 'CONFIG_GLUON_MULTIDOMAIN=y'
end end
if envtrue.GLUON_DEBUG then if istrue(env.GLUON_DEBUG) then
config 'CONFIG_DEBUG=y' config 'CONFIG_DEBUG=y'
config 'CONFIG_NO_STRIP=y' config 'CONFIG_NO_STRIP=y'
config '# CONFIG_USE_STRIP is not set' config '# CONFIG_USE_STRIP is not set'
......
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