summaryrefslogtreecommitdiff
path: root/src/apk_database.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-10-29 05:18:21 +0300
committerTimo Teräs <timo.teras@iki.fi>2011-10-29 05:18:21 +0300
commit500f8d4a7d7b17871647392e79e4c7a17c210534 (patch)
tree47d4b1cd04e374d88e26e352eeac9f51da083451 /src/apk_database.h
parente682e6596c101d634b3780a98773c8433b3baadb (diff)
downloadapk-tools-500f8d4a7d7b17871647392e79e4c7a17c210534.tar.gz
apk-tools-500f8d4a7d7b17871647392e79e4c7a17c210534.tar.bz2
apk-tools-500f8d4a7d7b17871647392e79e4c7a17c210534.tar.xz
apk-tools-500f8d4a7d7b17871647392e79e4c7a17c210534.zip
solver, db: implement repository pinning
Improves /etc/apk/repositories format so you can say: http://nl.alpinelinux.org/alpine/v2.3/main @edge http://nl.alpinelinux.org/alpine/edge/main @testing http://nl.alpinelinux.org/alpine/edge/testing After which you can pin dependencies to these tags using: apk add stableapp newapp@edge bleedingapp@testing Apk will now by default only use the untagged repositories, but adding a tag to specific dependency: 1. will prefer that tag for the name 2. allowing pulling in dependencies from that tag (though, it prefers untagged packages to satisfy deps if possible) fixes #575
Diffstat (limited to 'src/apk_database.h')
-rw-r--r--src/apk_database.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/apk_database.h b/src/apk_database.h
index d7c4f5b..e5d28f4 100644
--- a/src/apk_database.h
+++ b/src/apk_database.h
@@ -115,10 +115,15 @@ struct apk_db_options {
struct list_head repository_list;
};
+struct apk_repository_tag {
+ unsigned int allowed_repos;
+ apk_blob_t *name;
+};
+
struct apk_database {
char *root;
int root_fd, lock_fd, cache_fd, cachetmp_fd, keys_fd;
- unsigned num_repos;
+ unsigned num_repos, num_repo_tags;
const char *cache_dir;
char *cache_remount_dir;
apk_blob_t *arch;
@@ -131,6 +136,7 @@ struct apk_database {
struct apk_dependency_array *world;
struct apk_string_array *protected_paths;
struct apk_repository repos[APK_MAX_REPOS];
+ struct apk_repository_tag repo_tags[APK_MAX_REPOS];
struct apk_id_cache id_cache;
struct {
@@ -158,6 +164,7 @@ typedef union apk_database_or_void {
struct apk_name *apk_db_get_name(struct apk_database *db, apk_blob_t name);
struct apk_name *apk_db_query_name(struct apk_database *db, apk_blob_t name);
+int apk_db_get_tag_id(struct apk_database *db, apk_blob_t tag);
struct apk_db_dir *apk_db_dir_query(struct apk_database *db,
apk_blob_t name);
struct apk_db_file *apk_db_file_query(struct apk_database *db,