diff options
author | Timo Teräs <timo.teras@iki.fi> | 2019-12-30 16:15:44 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2019-12-30 16:17:14 +0200 |
commit | 0b82bcc53e6027c74fae2c972d5d9fff54d95d6c (patch) | |
tree | 934b736a1447200f89092cf2d45fd3cb19284e6b /src | |
parent | 90fc52e2b8e3396ad600439b20840ee717e44419 (diff) | |
download | apk-tools-0b82bcc53e6027c74fae2c972d5d9fff54d95d6c.tar.gz apk-tools-0b82bcc53e6027c74fae2c972d5d9fff54d95d6c.tar.bz2 apk-tools-0b82bcc53e6027c74fae2c972d5d9fff54d95d6c.tar.xz apk-tools-0b82bcc53e6027c74fae2c972d5d9fff54d95d6c.zip |
lua: fix build and update to lua5.3
Fixes #8360
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/lua-apk.c | 35 |
2 files changed, 21 insertions, 16 deletions
diff --git a/src/Makefile b/src/Makefile index e307ceb..52ea1b2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -9,7 +9,7 @@ ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib) # lua module ifneq ($(LUAAPK),) -LUA_VERSION ?= 5.2 +LUA_VERSION ?= 5.3 LUA_PC ?= lua$(LUA_VERSION) LUA_LIBDIR ?= /usr/lib/lua/$(LUA_VERSION) LIBAPK := YesPlease diff --git a/src/lua-apk.c b/src/lua-apk.c index 532577a..2f365b2 100644 --- a/src/lua-apk.c +++ b/src/lua-apk.c @@ -17,24 +17,24 @@ #endif struct flagmap { - const char *name; - int flag; + const char *name; + int flag; }; struct flagmap opendb_flagmap[] = { - {"read", APK_OPENF_READ}, - {"write", APK_OPENF_WRITE}, - {"create", APK_OPENF_CREATE}, - {"no_installed", APK_OPENF_NO_INSTALLED}, - {"no_scripts", APK_OPENF_NO_SCRIPTS}, - {"no_world", APK_OPENF_NO_WORLD}, - {"no_sys_repos", APK_OPENF_NO_SYS_REPOS}, - {"no_installed_repo", APK_OPENF_NO_INSTALLED_REPO}, - {"no_repos", APK_OPENF_NO_REPOS}, - {"no_state", APK_OPENF_NO_STATE}, - {"no_scripts", APK_OPENF_NO_SCRIPTS}, - {"no_world", APK_OPENF_NO_WORLD}, - {NULL, 0} + {"read", APK_OPENF_READ}, + {"write", APK_OPENF_WRITE}, + {"create", APK_OPENF_CREATE}, + {"no_installed", APK_OPENF_NO_INSTALLED}, + {"no_scripts", APK_OPENF_NO_SCRIPTS}, + {"no_world", APK_OPENF_NO_WORLD}, + {"no_sys_repos", APK_OPENF_NO_SYS_REPOS}, + {"no_installed_repo", APK_OPENF_NO_INSTALLED_REPO}, + {"no_repos", APK_OPENF_NO_REPOS}, + {"no_state", APK_OPENF_NO_STATE}, + {"no_scripts", APK_OPENF_NO_SCRIPTS}, + {"no_world", APK_OPENF_NO_WORLD}, + {NULL, 0} }; /* implemented as luaL_typerror until lua 5.1, dropped in 5.2 @@ -46,6 +46,11 @@ static int typerror (lua_State *L, int narg, const char *tname) { return luaL_argerror(L, narg, msg); } +time_t apk_time(void) +{ + return time(NULL); +} + static apk_blob_t check_blob(lua_State *L, int index) { apk_blob_t blob; |