Commit 3f9fe4c2 authored by Timo Teräs's avatar Timo Teräs
Browse files

db: keep packages with no files with installed status

got broke few commits ago when apk_pkg_installed() call was
moved to happen after the package name has been read.
parent d67ee300
...@@ -587,17 +587,21 @@ int apk_db_index_read(struct apk_database *db, struct apk_bstream *bs, int repo) ...@@ -587,17 +587,21 @@ int apk_db_index_read(struct apk_database *db, struct apk_bstream *bs, int repo)
} }
/* Standard index line? */ /* Standard index line? */
if (apk_pkg_add_info(db, pkg, field, l) == 0) if (apk_pkg_add_info(db, pkg, field, l) == 0) {
if (repo == -1 && field == 'S') {
/* Instert to installed database; this needs to
* happen after package name has been read, but
* before first FDB entry. */
ipkg = apk_pkg_install(db, pkg);
diri_node = hlist_tail_ptr(&ipkg->owned_dirs);
}
continue; continue;
}
if (repo != -1) { if (repo != -1 || ipkg == NULL) {
apk_error("Invalid index entry '%c'", field); apk_error("Invalid index entry '%c'", field);
return -1; return -1;
} }
if (ipkg == NULL) {
ipkg = apk_pkg_install(db, pkg);
diri_node = hlist_tail_ptr(&ipkg->owned_dirs);
}
/* Check FDB special entries */ /* Check FDB special entries */
switch (field) { switch (field) {
......
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