scripts: fix luacheck warnings

This commit is contained in:
bobcanthelpyou 2019-06-17 22:41:09 +02:00
parent c9f1fdf6ee
commit b57093ae49
4 changed files with 11 additions and 6 deletions

View File

@ -1,8 +1,8 @@
env = setmetatable({}, { env = setmetatable({}, {
__index = function(t, k) return os.getenv(k) end __index = function(_, k) return os.getenv(k) end
}) })
envtrue = setmetatable({}, { envtrue = setmetatable({}, {
__index = function(t, k) return (tonumber(os.getenv(k)) or 0) > 0 end __index = function(_, k) return (tonumber(os.getenv(k)) or 0) > 0 end
}) })
assert(env.GLUON_SITEDIR) assert(env.GLUON_SITEDIR)
@ -117,7 +117,10 @@ end
local image_mt = { local image_mt = {
__index = { __index = {
dest_name = function(image, name, site, release) dest_name = function(image, name, site, release)
return env.GLUON_IMAGEDIR..'/'..image.subdir, 'gluon-'..(site or site_code)..'-'..(release or env.GLUON_RELEASE)..'-'..name..image.out_suffix..image.extension return env.GLUON_IMAGEDIR .. '/' .. image.subdir,
'gluon-' .. (site or site_code) .. '-'
.. (release or env.GLUON_RELEASE) .. '-'
.. name .. image.out_suffix .. image.extension
end, end,
}, },
} }

View File

@ -40,7 +40,8 @@ for _, image in ipairs(images) do
clean(image, image.image) clean(image, image.image)
local destdir, destname = image:dest_name(image.image) local destdir, destname = image:dest_name(image.image)
local source = string.format('openwrt/bin/targets/%s/openwrt-%s-%s%s%s', bindir, openwrt_target, image.name, image.in_suffix, image.extension) local source = string.format('openwrt/bin/targets/%s/openwrt-%s-%s%s%s', bindir,
openwrt_target, image.name, image.in_suffix, image.extension)
exec {'cp', source, destdir..'/'..destname} exec {'cp', source, destdir..'/'..destname}

View File

@ -69,7 +69,8 @@ for _, dev in ipairs(devices) do
handle_pkg(pkg) handle_pkg(pkg)
end end
config_message(string.format("unable to enable device '%s'", profile), 'CONFIG_TARGET_DEVICE_%s_DEVICE_%s=y', openwrt_config_target, profile) config_message(string.format("unable to enable device '%s'", profile),
'CONFIG_TARGET_DEVICE_%s_DEVICE_%s=y', openwrt_config_target, profile)
config('CONFIG_TARGET_DEVICE_PACKAGES_%s_DEVICE_%s="%s"', config('CONFIG_TARGET_DEVICE_PACKAGES_%s_DEVICE_%s="%s"',
openwrt_config_target, profile, device_pkgs) openwrt_config_target, profile, device_pkgs)
end end

View File

@ -49,7 +49,7 @@ end
function config_package(pkg, value) function config_package(pkg, value)
local pattern = string.format('CONFIG_PACKAGE_%s=%s', pkg, value) local pattern = string.format('CONFIG_PACKAGE_%s=%s', pkg, value)
local ret local res
if value == 'y' then if value == 'y' then
res = check_config(pattern) res = check_config(pattern)
else else