Re: [gentoo-portage-dev] [PATCH] _solve_..slot_conflicts: make "forced" set recursive (bug 632210)

2017-09-29 Thread Zac Medico
On 09/29/2017 06:16 AM, Brian Dolbec wrote:
> On Fri, 29 Sep 2017 00:26:01 -0700
> Zac Medico  wrote:
> 
>> When the slot conflict solver decides that it is "forced"
>> to choose a particular package, recursively force the
>> dependencies as well. Prior to this fix, substitution of
>> @world in the arguments for SlotConflictMaskUpdateTestCase
>> caused the test to fail because the solver removed
>> boost-build-1.53.0 from the graph event though it had
>> added the parent boost-1.53.0 package to the "forced"
>> set.
>>
>> X-Gentoo-bug: 632210
>> X-Gentoo-bug-url: https://bugs.gentoo.org/632210
>> ---
>>  pym/_emerge/depgraph.py | 13
>> + pym/portage/tests/resolver/test_slot_conflict_update.py
>> |  2 +- 2 files changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
>> index 785c036b8..3b81c5c76 100644
>> --- a/pym/_emerge/depgraph.py
>> +++ b/pym/_emerge/depgraph.py
>> @@ -1457,6 +1457,19 @@ class depgraph(object):
>>  
>>  # Remove 'non_conflict_node' and or_tuples from
>> 'forced'. forced = set(pkg for pkg in forced if isinstance(pkg,
>> Package)) +
>> +# Add dependendencies of forced packages.
>> +stack = list(forced)
>> +traversed = set()
>> +while stack:
>> +pkg = stack.pop()
>> +traversed.add(pkg)
>> +for child in conflict_graph.child_nodes(pkg):
>> +if (isinstance(child, Package) and
>> +child not in traversed):
>> +forced.add(child)
>> +stack.append(child)
>> +
>>  non_forced = set(pkg for pkg in conflict_pkgs if pkg
>> not in forced) 
>>  if debug:
>> diff --git a/pym/portage/tests/resolver/test_slot_conflict_update.py
>> b/pym/portage/tests/resolver/test_slot_conflict_update.py index
>> 331e5788b..f251d01f1 100644 ---
>> a/pym/portage/tests/resolver/test_slot_conflict_update.py +++
>> b/pym/portage/tests/resolver/test_slot_conflict_update.py @@ -80,7
>> +80,7 @@ class SlotConflictUpdateTestCase(TestCase): # this behavior
>> makes SlotConflictMaskUpdateTestCase # fail.
>>  ResolverPlaygroundTestCase(
>> -world,
>> +['@world'],
>>  all_permutations = True,
>>  options = {"--update": True,
>> "--deep": True}, success = True,
> 
> looks good
> 

Thanks, merged:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a65670ec2b0850c278b85c6417c20d8a4ca7734

-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] [PATCH] _solve_..slot_conflicts: handle forced reinstall (bug 632202)

2017-09-29 Thread Zac Medico
On 09/29/2017 06:16 AM, Brian Dolbec wrote:
> On Fri, 29 Sep 2017 01:15:59 -0700
> Zac Medico  wrote:
> 
>> Fix the slot conflict solver to use the _want_installed_pkg
>> method to identify installed packages that are intended to
>> be reinstalled for some reason (such as @preserved-rebuild).
>>
>> X-Gentoo-bug: 632202
>> X-Gentoo-bug-url: https://bugs.gentoo.org/632202
>> ---
>>  pym/_emerge/depgraph.py | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
>> index 3b81c5c76..b0149c4dc 100644
>> --- a/pym/_emerge/depgraph.py
>> +++ b/pym/_emerge/depgraph.py
>> @@ -1337,7 +1337,8 @@ class depgraph(object):
>>  
>> self._dynamic_config._parent_atoms.get(pkg,
>> [])) 
>>  for parent, atom in all_parent_atoms:
>> -is_arg_parent = isinstance(parent,
>> AtomArg)
>> +is_arg_parent = (inst_pkg is not
>> None and
>> +not
>> self._want_installed_pkg(inst_pkg)) is_non_conflict_parent = parent
>> not in conflict_pkgs and \ parent not in indirect_conflict_pkgs
>>  
> 
> 
> looks good
> 

Thanks, merged:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=d82bf7c0a2cfa9590849aa7fd3ea1257a7f45006
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] [PATCH] _solve_..slot_conflicts: handle forced reinstall (bug 632202)

2017-09-29 Thread Brian Dolbec
On Fri, 29 Sep 2017 01:15:59 -0700
Zac Medico  wrote:

> Fix the slot conflict solver to use the _want_installed_pkg
> method to identify installed packages that are intended to
> be reinstalled for some reason (such as @preserved-rebuild).
> 
> X-Gentoo-bug: 632202
> X-Gentoo-bug-url: https://bugs.gentoo.org/632202
> ---
>  pym/_emerge/depgraph.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
> index 3b81c5c76..b0149c4dc 100644
> --- a/pym/_emerge/depgraph.py
> +++ b/pym/_emerge/depgraph.py
> @@ -1337,7 +1337,8 @@ class depgraph(object):
>   
> self._dynamic_config._parent_atoms.get(pkg,
> [])) 
>   for parent, atom in all_parent_atoms:
> - is_arg_parent = isinstance(parent,
> AtomArg)
> + is_arg_parent = (inst_pkg is not
> None and
> + not
> self._want_installed_pkg(inst_pkg)) is_non_conflict_parent = parent
> not in conflict_pkgs and \ parent not in indirect_conflict_pkgs
>  


looks good

-- 
Brian Dolbec 




Re: [gentoo-portage-dev] [PATCH] _solve_..slot_conflicts: make "forced" set recursive (bug 632210)

2017-09-29 Thread Brian Dolbec
On Fri, 29 Sep 2017 00:26:01 -0700
Zac Medico  wrote:

> When the slot conflict solver decides that it is "forced"
> to choose a particular package, recursively force the
> dependencies as well. Prior to this fix, substitution of
> @world in the arguments for SlotConflictMaskUpdateTestCase
> caused the test to fail because the solver removed
> boost-build-1.53.0 from the graph event though it had
> added the parent boost-1.53.0 package to the "forced"
> set.
> 
> X-Gentoo-bug: 632210
> X-Gentoo-bug-url: https://bugs.gentoo.org/632210
> ---
>  pym/_emerge/depgraph.py | 13
> + pym/portage/tests/resolver/test_slot_conflict_update.py
> |  2 +- 2 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
> index 785c036b8..3b81c5c76 100644
> --- a/pym/_emerge/depgraph.py
> +++ b/pym/_emerge/depgraph.py
> @@ -1457,6 +1457,19 @@ class depgraph(object):
>  
>   # Remove 'non_conflict_node' and or_tuples from
> 'forced'. forced = set(pkg for pkg in forced if isinstance(pkg,
> Package)) +
> + # Add dependendencies of forced packages.
> + stack = list(forced)
> + traversed = set()
> + while stack:
> + pkg = stack.pop()
> + traversed.add(pkg)
> + for child in conflict_graph.child_nodes(pkg):
> + if (isinstance(child, Package) and
> + child not in traversed):
> + forced.add(child)
> + stack.append(child)
> +
>   non_forced = set(pkg for pkg in conflict_pkgs if pkg
> not in forced) 
>   if debug:
> diff --git a/pym/portage/tests/resolver/test_slot_conflict_update.py
> b/pym/portage/tests/resolver/test_slot_conflict_update.py index
> 331e5788b..f251d01f1 100644 ---
> a/pym/portage/tests/resolver/test_slot_conflict_update.py +++
> b/pym/portage/tests/resolver/test_slot_conflict_update.py @@ -80,7
> +80,7 @@ class SlotConflictUpdateTestCase(TestCase): # this behavior
> makes SlotConflictMaskUpdateTestCase # fail.
>   ResolverPlaygroundTestCase(
> - world,
> + ['@world'],
>   all_permutations = True,
>   options = {"--update": True,
> "--deep": True}, success = True,

looks good

-- 
Brian Dolbec 




[gentoo-portage-dev] [PATCH] _solve_..slot_conflicts: handle forced reinstall (bug 632202)

2017-09-29 Thread Zac Medico
Fix the slot conflict solver to use the _want_installed_pkg
method to identify installed packages that are intended to
be reinstalled for some reason (such as @preserved-rebuild).

X-Gentoo-bug: 632202
X-Gentoo-bug-url: https://bugs.gentoo.org/632202
---
 pym/_emerge/depgraph.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3b81c5c76..b0149c4dc 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1337,7 +1337,8 @@ class depgraph(object):

self._dynamic_config._parent_atoms.get(pkg, []))
 
for parent, atom in all_parent_atoms:
-   is_arg_parent = isinstance(parent, AtomArg)
+   is_arg_parent = (inst_pkg is not None and
+   not self._want_installed_pkg(inst_pkg))
is_non_conflict_parent = parent not in 
conflict_pkgs and \
parent not in indirect_conflict_pkgs
 
-- 
2.13.5




[gentoo-portage-dev] [PATCH] _solve_..slot_conflicts: make "forced" set recursive (bug 632210)

2017-09-29 Thread Zac Medico
When the slot conflict solver decides that it is "forced"
to choose a particular package, recursively force the
dependencies as well. Prior to this fix, substitution of
@world in the arguments for SlotConflictMaskUpdateTestCase
caused the test to fail because the solver removed
boost-build-1.53.0 from the graph event though it had
added the parent boost-1.53.0 package to the "forced"
set.

X-Gentoo-bug: 632210
X-Gentoo-bug-url: https://bugs.gentoo.org/632210
---
 pym/_emerge/depgraph.py | 13 +
 pym/portage/tests/resolver/test_slot_conflict_update.py |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 785c036b8..3b81c5c76 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1457,6 +1457,19 @@ class depgraph(object):
 
# Remove 'non_conflict_node' and or_tuples from 'forced'.
forced = set(pkg for pkg in forced if isinstance(pkg, Package))
+
+   # Add dependendencies of forced packages.
+   stack = list(forced)
+   traversed = set()
+   while stack:
+   pkg = stack.pop()
+   traversed.add(pkg)
+   for child in conflict_graph.child_nodes(pkg):
+   if (isinstance(child, Package) and
+   child not in traversed):
+   forced.add(child)
+   stack.append(child)
+
non_forced = set(pkg for pkg in conflict_pkgs if pkg not in 
forced)
 
if debug:
diff --git a/pym/portage/tests/resolver/test_slot_conflict_update.py 
b/pym/portage/tests/resolver/test_slot_conflict_update.py
index 331e5788b..f251d01f1 100644
--- a/pym/portage/tests/resolver/test_slot_conflict_update.py
+++ b/pym/portage/tests/resolver/test_slot_conflict_update.py
@@ -80,7 +80,7 @@ class SlotConflictUpdateTestCase(TestCase):
# this behavior makes SlotConflictMaskUpdateTestCase
# fail.
ResolverPlaygroundTestCase(
-   world,
+   ['@world'],
all_permutations = True,
options = {"--update": True, "--deep": True},
success = True,
-- 
2.13.5