summaryrefslogtreecommitdiff
path: root/src/apk_database.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-02-15 13:57:36 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-02-15 13:57:36 +0200
commit41fb3a4f9e5949a66fedc069f94b75c18614728d (patch)
treeff3ce7bcba056015a01edabc9e55d50894b9eb2a /src/apk_database.h
parent29064d88f3a972b69a006d7a8092159bd65ef03f (diff)
downloadapk-tools-41fb3a4f9e5949a66fedc069f94b75c18614728d.tar.gz
apk-tools-41fb3a4f9e5949a66fedc069f94b75c18614728d.tar.bz2
apk-tools-41fb3a4f9e5949a66fedc069f94b75c18614728d.tar.xz
apk-tools-41fb3a4f9e5949a66fedc069f94b75c18614728d.zip
solver, db: repository pinning improvements
* solver internally calculates now using tags; not repository masks * installeddb now contains the tag name where the package came from -> we can now handle upgrades properly * the pinning is still a preference, and not strictly enforced; versioned dependencies may overrule preference
Diffstat (limited to 'src/apk_database.h')
-rw-r--r--src/apk_database.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/apk_database.h b/src/apk_database.h
index 690b757..37dc557 100644
--- a/src/apk_database.h
+++ b/src/apk_database.h
@@ -35,6 +35,7 @@
#endif
#define APK_MAX_REPOS 32
+#define APK_MAX_TAGS 16
#define APK_CACHE_CSUM_BYTES 4
extern const char * const apk_index_gz;
@@ -121,6 +122,9 @@ struct apk_db_options {
struct list_head repository_list;
};
+#define APK_DEFAULT_REPOSITORY_TAG 0
+#define APK_DEFAULT_PINNING_MASK BIT(APK_DEFAULT_REPOSITORY_TAG)
+
struct apk_repository_tag {
unsigned int allowed_repos;
apk_blob_t *name;
@@ -143,7 +147,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_repository_tag repo_tags[APK_MAX_TAGS];
struct apk_id_cache id_cache;
struct {
@@ -173,7 +177,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);
-int apk_db_get_tag_id_by_repos(struct apk_database *db, unsigned int repos);
+
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,