summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/database.c b/src/database.c
index 2fcb275..9c2e009 100644
--- a/src/database.c
+++ b/src/database.c
@@ -897,14 +897,6 @@ static int apk_db_read_state(struct apk_database *db, int flags)
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);
- }
- }
-
bs = apk_bstream_from_file(db->root_fd, "var/lib/apk/triggers");
if (bs != NULL) {
apk_db_triggers_read(db, bs);
@@ -1139,6 +1131,14 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
}
if (!(dbopts->open_flags & APK_OPENF_NO_REPOS)) {
+ 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);
+ }
+ }
+
list_for_each_entry(repo, &dbopts->repository_list, list) {
r = apk_db_add_repository(db, APK_BLOB_STR(repo->url));
rr = r ?: rr;