Skip to content

Commit a61c641

Browse files
committed
More conflict detection changes
1 parent 2b6f980 commit a61c641

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

pythonforandroid/toolchain.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,11 @@ def add(self, dependent, dependency):
425425
if dependent != dependency:
426426
self.graph[dependent].add(dependency)
427427

428+
def conflicts(self, conflict):
429+
if conflict in self.graph:
430+
return True
431+
return False
432+
428433
def add_optional(self, dependent, dependency):
429434
"""Add an optional (ordering only) dependency relationship to the graph
430435
@@ -1878,7 +1883,7 @@ def build_recipes(names, ctx):
18781883
recipes_to_load = set(names)
18791884
bs = ctx.bootstrap
18801885
if bs is not None and bs.recipe_depends:
1881-
info('Bootstrap requires recipes {}'.format(bs.recipe_depends))
1886+
info_notify('Bootstrap requires recipes {}'.format(bs.recipe_depends))
18821887
recipes_to_load = recipes_to_load.union(set(bs.recipe_depends))
18831888
recipes_to_load = list(recipes_to_load)
18841889
recipe_loaded = []
@@ -1894,22 +1899,25 @@ def build_recipes(names, ctx):
18941899
python_modules.append(name)
18951900
continue
18961901
graph.add(name, name)
1897-
info('Loaded recipe {} (depends on {}, conflicts {})'.format(name, recipe.depends, recipe.conflicts))
1902+
info('Loaded recipe {} (depends on {}{})'.format(
1903+
name, recipe.depends,
1904+
', conflicts {}'.format(recipe.conflicts) if recipe.conflicts else ''))
18981905
for depend in recipe.depends:
18991906
graph.add(name, depend)
19001907
recipes_to_load += recipe.depends
19011908
for conflict in recipe.conflicts:
1902-
if conflict in graph.graph:
1909+
if graph.conflicts(conflict):
19031910
warning(
19041911
('{} conflicts with {}, but both have been '
19051912
'included in the requirements.'.format(recipe.name, conflict)))
19061913
warning('Due to this conflict the build cannot continue, exiting.')
19071914
exit(1)
19081915
recipe_loaded.append(name)
19091916
build_order = list(graph.find_order())
1910-
info("Recipe build order is {}".format(build_order))
1911-
info_notify(('The requirements ({}) were not found as recipes, they will be '
1912-
'installed with pip.').format(', '.join(python_modules)))
1917+
info_notify("Recipe build order is {}".format(build_order))
1918+
if python_modules:
1919+
info_notify(('The requirements ({}) were not found as recipes, they will be '
1920+
'installed with pip.').format(', '.join(python_modules)))
19131921
ctx.recipe_build_order = build_order
19141922

19151923
recipes = [Recipe.get_recipe(name, ctx) for name in build_order]

0 commit comments

Comments
 (0)