summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-05-19 09:39:57 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-05-19 09:39:57 +0000
commit9e58b2dd55f0baf6099836695066c58bb04ba9f8 (patch)
treeec440dd0e341d80a0ba13a3977e3fefa87fd0abc /src
parent250dee41018f11b1ed63c3aca2475d649f556a8d (diff)
downloadapk-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')
-rw-r--r--src/database.c15
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);