[noarch/entropy] make unwanted deps QA check work better with multiple slotted deps

This commit is contained in:
Fabio Erculiani 2012-04-23 21:54:36 +02:00
parent a8f695c19f
commit 4942da371f

View File

@ -83,14 +83,25 @@ def check_unwanted_deps():
(entropy.dep.dep_getkey(x), (entropy.dep.dep_getslot(x), x)) \ (entropy.dep.dep_getkey(x), (entropy.dep.dep_getslot(x), x)) \
for x in pkg_deps if not x.startswith("!")) for x in pkg_deps if not x.startswith("!"))
pkg_deps_map = {}
for pkg_dep in pkg_deps:
if x.startswith("!"):
continue
key = entropy.dep.dep_getkey(pkg_dep)
obj = pkg_deps_map.setdefault(key, [])
val = entropy.dep.dep_getslot(pkg_dep), pkg_dep
obj.append(val)
for unwanted_dep in unwanted_deps: for unwanted_dep in unwanted_deps:
unwanted_slot = entropy.dep.dep_getslot(unwanted_dep) unwanted_slot = entropy.dep.dep_getslot(unwanted_dep)
if unwanted_slot: if unwanted_slot:
unwanted_dep = entropy.dep.remove_slot(unwanted_dep) unwanted_dep = entropy.dep.remove_slot(unwanted_dep)
dep_data = pkg_deps_map.get(unwanted_dep) dep_data_list = pkg_deps_map.get(unwanted_dep)
if dep_data is None: if dep_data_list is None:
continue continue
for dep_data in dep_data_list:
dep_slot, dep = dep_data dep_slot, dep = dep_data
if not unwanted_slot: if not unwanted_slot:
@ -108,9 +119,11 @@ def check_unwanted_deps():
if warning_slot: if warning_slot:
warning_dep = entropy.dep.remove_slot(warning_dep) warning_dep = entropy.dep.remove_slot(warning_dep)
dep_data = pkg_deps_map.get(warning_dep) dep_data_list = pkg_deps_map.get(warning_dep)
if dep_data is None: if dep_data_list is None:
continue continue
for dep_data in dep_data_list:
dep_slot, dep = dep_data dep_slot, dep = dep_data
if not warning_slot: if not warning_slot: