Commit c79302d9 authored by Natanael Copa's avatar Natanael Copa

lua: init fixes

- call apk_atom_init()
- if no open flag is specified, then default to read-only.
parent 08533d74
...@@ -148,8 +148,11 @@ static int Papk_db_open(lua_State *L) ...@@ -148,8 +148,11 @@ static int Papk_db_open(lua_State *L)
memset(&opts, 0, sizeof(opts)); memset(&opts, 0, sizeof(opts));
list_init(&opts.repository_list); list_init(&opts.repository_list);
if (lua_istable(L, 1)) if (lua_istable(L, 1))
get_dbopts(L, 1, &opts); get_dbopts(L, 1, &opts);
opts.open_flags |= APK_OPENF_READ;
db = lua_newuserdata(L, sizeof(struct apk_database)); db = lua_newuserdata(L, sizeof(struct apk_database));
luaL_getmetatable(L, APKDB_META); luaL_getmetatable(L, APKDB_META);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment