summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-05-30 08:46:30 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-05-30 08:48:32 +0300
commitaec93ee730f7a2e0196ae05fdd45e866d2510e41 (patch)
treeb51fdb4924941ea15eea0356fa6e69a7afc91e14 /src/apk.c
parent035da870362494bcb4ed092e27278c290b204410 (diff)
downloadapk-tools-aec93ee730f7a2e0196ae05fdd45e866d2510e41.tar.gz
apk-tools-aec93ee730f7a2e0196ae05fdd45e866d2510e41.tar.bz2
apk-tools-aec93ee730f7a2e0196ae05fdd45e866d2510e41.tar.xz
apk-tools-aec93ee730f7a2e0196ae05fdd45e866d2510e41.zip
db: unify handling of special packages
make cache a special kind of repository, and automatically cache special packages (virtual packages, or ones installed from command line). add test cases for handling virtual packages. fixes #1617.
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/apk.c b/src/apk.c
index 0404831..c834b76 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -476,7 +476,7 @@ int main(int argc, char **argv)
for (i = 0; i < test_repos->num; i++) {
struct apk_bstream *bs;
apk_blob_t spec = APK_BLOB_STR(test_repos->item[i]), name, tag;
- int repo_tag = 0;
+ int repo_tag = 0, repo = APK_REPOSITORY_FIRST_CONFIGURED + i;
if (apk_blob_split(spec, APK_BLOB_STR(":"), &tag, &name)) {
repo_tag = apk_db_get_tag_id(&db, tag);
@@ -486,9 +486,11 @@ int main(int argc, char **argv)
bs = apk_bstream_from_file(AT_FDCWD, name.ptr);
if (bs != NULL) {
- apk_db_index_read(&db, bs, i);
- db.repo_tags[repo_tag].allowed_repos |= BIT(i);
+ apk_db_index_read(&db, bs, repo);
bs->close(bs, NULL);
+ if (!(apk_flags & APK_NO_NETWORK))
+ db.available_repos |= BIT(repo);
+ db.repo_tags[repo_tag].allowed_repos |= BIT(repo);
}
}
#endif