summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/database.c b/src/database.c
index 91fcedd..33cd32a 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1439,9 +1439,11 @@ static int apk_db_name_rdepends(apk_hash_item item, void *pctx)
struct apk_provider *p;
struct apk_dependency *dep;
struct apk_name_array *touched;
+ unsigned num_virtual = 0;
apk_name_array_init(&touched);
foreach_array_item(p, name->providers) {
+ num_virtual += (p->pkg->name != name);
foreach_array_item(dep, p->pkg->depends) {
rname = dep->name;
rname->is_dependency |= !dep->conflict;
@@ -1460,6 +1462,12 @@ static int apk_db_name_rdepends(apk_hash_item item, void *pctx)
}
}
}
+ if (num_virtual == 0)
+ name->priority = 0;
+ else if (num_virtual != name->providers->num)
+ name->priority = 1;
+ else
+ name->priority = 2;
foreach_array_item(n0, touched)
(*n0)->state_int = 0;
apk_name_array_free(&touched);