diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-19 09:39:57 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-19 09:39:57 +0000 |
commit | 9e58b2dd55f0baf6099836695066c58bb04ba9f8 (patch) | |
tree | ec440dd0e341d80a0ba13a3977e3fefa87fd0abc /src/database.c | |
parent | 250dee41018f11b1ed63c3aca2475d649f556a8d (diff) | |
download | apk-tools-9e58b2dd55f0baf6099836695066c58bb04ba9f8.tar.gz apk-tools-9e58b2dd55f0baf6099836695066c58bb04ba9f8.tar.bz2 apk-tools-9e58b2dd55f0baf6099836695066c58bb04ba9f8.tar.xz apk-tools-9e58b2dd55f0baf6099836695066c58bb04ba9f8.zip |
db: warn rather than fail with error if a repo index fails to load
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/database.c b/src/database.c index 8d96634..7ec9764 100644 --- a/src/database.c +++ b/src/database.c @@ -717,21 +717,16 @@ int apk_db_open(struct apk_database *db, const char *root, unsigned int flags) apk_repos = "/etc/apk/repositories"; blob = apk_blob_from_file(apk_repos); if (!APK_BLOB_IS_NULL(blob)) { - r = apk_blob_for_each_segment(blob, "\n", - apk_db_add_repository, db); + apk_blob_for_each_segment(blob, "\n", + apk_db_add_repository, db); free(blob.ptr); - if (r != 0) - goto ret_r; } } } if (!(flags & APK_OPENF_EMPTY_REPOS)) { - list_for_each_entry(repo, &apk_repository_list.list, list) { - r = apk_db_add_repository(db, APK_BLOB_STR(repo->url)); - if (r != 0) - goto ret_r; - } + list_for_each_entry(repo, &apk_repository_list.list, list) + apk_db_add_repository(db, APK_BLOB_STR(repo->url)); } fchdir(apk_cwd_fd); @@ -1009,7 +1004,7 @@ int apk_db_add_repository(apk_database_t _db, apk_blob_t repository) is = apk_bstream_gunzip(apk_repository_file_open(&db->repos[r], name), 1); } if (is == NULL) { - apk_error("Failed to open index for %s", db->repos[r].url); + apk_warning("Failed to open index for %s", db->repos[r].url); return -1; } apk_db_index_read(db, is, r); |