diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-02-19 04:25:05 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-09-15 17:13:08 +0000 |
commit | c79302d9732087dd13e8b1a9a4edb9ed13e78ce7 (patch) | |
tree | 438808e7ad88e2dcc6767227e209d554c19076cb /src | |
parent | 08533d74fad85d1179b697655273dc6675e8d581 (diff) | |
download | apk-tools-c79302d9732087dd13e8b1a9a4edb9ed13e78ce7.tar.gz apk-tools-c79302d9732087dd13e8b1a9a4edb9ed13e78ce7.tar.bz2 apk-tools-c79302d9732087dd13e8b1a9a4edb9ed13e78ce7.tar.xz apk-tools-c79302d9732087dd13e8b1a9a4edb9ed13e78ce7.zip |
lua: init fixes
- call apk_atom_init()
- if no open flag is specified, then default to read-only.
Diffstat (limited to 'src')
-rw-r--r-- | src/lua-apk.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lua-apk.c b/src/lua-apk.c index eae7869..31987a6 100644 --- a/src/lua-apk.c +++ b/src/lua-apk.c @@ -148,8 +148,11 @@ static int Papk_db_open(lua_State *L) memset(&opts, 0, sizeof(opts)); list_init(&opts.repository_list); + apk_atom_init(); if (lua_istable(L, 1)) get_dbopts(L, 1, &opts); + else + opts.open_flags |= APK_OPENF_READ; db = lua_newuserdata(L, sizeof(struct apk_database)); luaL_getmetatable(L, APKDB_META); |