summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/util.lua
AgeCommit message (Collapse)Author
2016-08-04luci-base: improve string format error reportingJo-Philipp Wich
In mod metamethod, execute string format under pcall() and rethrow error in caller context to report caller of function in errors and not the meta method itself. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-04-08luci-base: utils: Make checklib return a booleanDaniel Dickinson
Using tristate is counter-intuitive and probably doesn't provide a lot of benefit so we use a boolean and treat "don't know" as false (because it is safer than showing options that are not actually available). Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
2016-03-25luci-base: Add option to check linked librariesDaniel Dickinson
Some packages have different variants that have different capabilities depending on which libraries against which they are linked. Add a function to check which library a binary links against in order to determine available functionality. Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
2016-03-20luci-base: fix bug in util.lua in 'shellsqescape'Hannu Nyman
Fix a bug introduced by #561 Function 'shellsqescape' calls 'gsub' with the empty result string 'res' instead of the actual parameter 'value'. This leads into error: .../util.lua:160: bad argument #1 to 'gsub' (string expected, got nil) Fix error by passing the correct parameter to the function. After the fix, the unmount button introduced by #561 finally works. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-12-02luci-base: Add function for shell single-quote parameter escapingDaniel Dickinson
When using os.execute or luci.sys.call the shell is called with the command line which means that standard shell interpretation of strings occurs. To allow to use these commands more easily we add functions for properly escaping single-quoted strings used on the command line
2015-11-21luci-base: switch to luci-lib-jsoncJo-Philipp Wich
Add dependency on luci-lib-jsonc and use it to reimplement luci.util.serialize_json(). Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-03-18luci-base: fix backslash escaping in luci.util.serialize_json()Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-29Move inline documentation into separate files.Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-22luci-base: add luci.util.serialize_json()Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-16Globally reduce copyright headersJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-15luci-base: add luci.util.ubus()Jo-Philipp Wich
Add luci.util.ubus() convenience wrapper which establishes a connection on the first call. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08luci-base: luci.util: rewrite threadlocal code to not confuse minifierJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08Rework LuCI build systemJo-Philipp Wich
* Rename subdirectories to their repective OpenWrt package names * Make each LuCI module its own standalone package * Deploy a shared luci.mk which is used by each module Makefile Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>