diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-02-17 12:23:01 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-02-17 12:23:01 +0000 |
commit | ca51ec323839598928fca85cec3bd3109fd32658 (patch) | |
tree | 8254fcc74770eff26c1e27576d4acb6313224b0a /src/database.c | |
parent | 6e55a18269f12458608d1259dd4b6391f48db3e2 (diff) | |
download | apk-tools-ca51ec323839598928fca85cec3bd3109fd32658.tar.gz apk-tools-ca51ec323839598928fca85cec3bd3109fd32658.tar.bz2 apk-tools-ca51ec323839598928fca85cec3bd3109fd32658.tar.xz apk-tools-ca51ec323839598928fca85cec3bd3109fd32658.zip |
db: allow more than one --repository arg
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/database.c b/src/database.c index 621c03c..743fd83 100644 --- a/src/database.c +++ b/src/database.c @@ -621,6 +621,7 @@ int apk_db_open(struct apk_database *db, const char *root, unsigned int flags) apk_blob_t blob; const char *apk_repos = getenv("APK_REPOS"), *msg; int r; + struct apk_repository_url *repo = NULL; memset(db, 0, sizeof(*db)); apk_hash_init(&db->available.names, &pkg_name_hash_ops, 1000); @@ -696,10 +697,10 @@ int apk_db_open(struct apk_database *db, const char *root, unsigned int flags) } } - if (apk_repository != NULL) { - r = apk_db_add_repository(db, APK_BLOB_STR(apk_repository)); + list_for_each_entry(repo, &apk_repository_list.list, list) { + r = apk_db_add_repository(db, APK_BLOB_STR(repo->url)); if (r != 0) { - msg = "Unable to load repositories"; + msg = repo->url; goto ret_r; } } |