Commit 123226ba authored by Timo Teräs's avatar Timo Teräs
Browse files

db: load cache's installed index only if cache is active

other wise cache_fd points to var/lib/apk and contains the real
installed db causing it to be loaded twice.
parent ea901526
......@@ -749,10 +749,12 @@ static int apk_db_read_state(struct apk_database *db, int flags)
bs->close(bs, NULL);
}
bs = apk_bstream_from_file(db->cache_fd, "installed");
if (bs != NULL) {
apk_db_index_read(db, bs, -2);
bs->close(bs, NULL);
if (apk_db_cache_active(db)) {
bs = apk_bstream_from_file(db->cache_fd, "installed");
if (bs != NULL) {
apk_db_index_read(db, bs, -2);
bs->close(bs, NULL);
}
}
}
......
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