summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/database.c b/src/database.c
index dd3f4b5..e3c10c5 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1475,6 +1475,17 @@ int apk_db_get_tag_id(struct apk_database *db, apk_blob_t tag)
return -1;
}
+int apk_db_get_tag_id_by_repos(struct apk_database *db, unsigned int repos)
+{
+ int i;
+
+ for (i = 0; i < db->num_repo_tags; i++) {
+ if (db->repo_tags[i].allowed_repos & repos)
+ return i;
+ }
+ return -1;
+}
+
static int fire_triggers(apk_hash_item item, void *ctx)
{
struct apk_database *db = (struct apk_database *) ctx;