+function getPackageVersion()
+ local opkgFile = "/usr/lib/opkg/status"
+ local line
+ local flag = false
+ for line in io.lines(opkgFile) do
+ if flag then
+ return line:match('[%d%.$-]+') or ""
+ elseif line:find("Package: " .. packageName:gsub("%-", "%%%-")) then
+ flag = true
+ end
+ end
+ return ""
+end
+
+function createHelperText()
+ local initText = "<br />" .. translate("For more information on different options check") .. " "
+ for filename in fs.dir(providers_dir) do
+ local p_func = loadfile(providers_dir .. filename)
+ setfenv(p_func, { _ = i18n.translate })
+ local p = p_func()
+ if p.help_link then
+ local url, domain
+ url = p.help_link
+ domain = p.help_link_text or url:match('^%w+://([^/]+)')
+ if not helperText:find(domain) then
+ if helperText == "" then
+ helperText = initText
+ else
+ helperText = helperText .. ", "
+ end
+ helperText = helperText .. [[<a href="]] .. url .. [[" target="_blank">]] .. domain .. [[</a>]]
+ end
+ end
+ end
+ if helperText ~= "" then
+ local a = helperText:gsub('(.*),%s.*$', '%1')
+ helperText = a .. " " .. translate("and") .. helperText:sub(#a + 2) .. "."
+ end
+end
+
+function getProviderName(value)