[gentoo-portage-dev] Re: [PATCH] pkg_use_display: show masked/forced state of USE_EXPAND flags (bug 490562)
On Wed, Mar 22, 2017 at 9:32 AM, Zac Medicowrote: > Fix pkg_use_display to test if the prefixed flag is in use.force or > use.mask, rather than the unprefixed flag. > > X-Gentoo-bug: 490562 > X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=490562 > --- > pym/_emerge/UseFlagDisplay.py | 19 +-- > 1 file changed, 13 insertions(+), 6 deletions(-) Bump. -- Thanks, Zac
Re: [gentoo-portage-dev] [PATCH] pkg_use_display: show masked/forced state of USE_EXPAND flags (bug 490562)
On Wed, 22 Mar 2017 09:32:36 -0700 Zac Medicowrote: > Fix pkg_use_display to test if the prefixed flag is in use.force or > use.mask, rather than the unprefixed flag. > > X-Gentoo-bug: 490562 > X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=490562 > --- > pym/_emerge/UseFlagDisplay.py | 19 +-- > 1 file changed, 13 insertions(+), 6 deletions(-) > > diff --git a/pym/_emerge/UseFlagDisplay.py > b/pym/_emerge/UseFlagDisplay.py index f460474..12820e9 100644 > --- a/pym/_emerge/UseFlagDisplay.py > +++ b/pym/_emerge/UseFlagDisplay.py > @@ -3,6 +3,7 @@ > > from __future__ import unicode_literals > > +import collections > from itertools import chain > import sys > > @@ -60,6 +61,10 @@ class UseFlagDisplay(object): > sort_separated = cmp_sort_key(_cmp_separated) > del _cmp_separated > > + > +_flag_info = collections.namedtuple('_flag_info', ('flag', > 'display')) + > + > def pkg_use_display(pkg, opts, modified_use=None): > settings = pkg.root_config.settings > use_expand = pkg.use.expand > @@ -81,27 +86,29 @@ def pkg_use_display(pkg, opts, modified_use=None): > if f.startswith(flag_prefix): > use_expand_flags.add(f) > use_enabled.setdefault( > - varname.upper(), > []).append(f[len(flag_prefix):]) > + varname.upper(), []).append( > + _flag_info(f, > f[len(flag_prefix):])) > for f in pkg.iuse.all: > if f.startswith(flag_prefix): > use_expand_flags.add(f) > if f not in use: > use_disabled.setdefault( > - varname.upper(), > []).append(f[len(flag_prefix):]) > + varname.upper(), > []).append( > + > _flag_info(f, f[len(flag_prefix):])) > var_order = set(use_enabled) > var_order.update(use_disabled) > var_order = sorted(var_order) > var_order.insert(0, 'USE') > use.difference_update(use_expand_flags) > - use_enabled['USE'] = list(use) > + use_enabled['USE'] = list(_flag_info(f, f) for f in use) > use_disabled['USE'] = [] > > for f in pkg.iuse.all: > if f not in use and \ > f not in use_expand_flags: > - use_disabled['USE'].append(f) > + use_disabled['USE'].append(_flag_info(f, f)) > > flag_displays = [] > for varname in var_order: > @@ -109,9 +116,9 @@ def pkg_use_display(pkg, opts, modified_use=None): > continue > flags = [] > for f in use_enabled.get(varname, []): > - flags.append(UseFlagDisplay(f, True, f in > forced_flags)) > + flags.append(UseFlagDisplay(f.display, True, > f.flag in forced_flags)) for f in use_disabled.get(varname, []): > - flags.append(UseFlagDisplay(f, False, f in > forced_flags)) > + flags.append(UseFlagDisplay(f.display, > False, f.flag in forced_flags)) if alphabetical_use: > flags.sort(key=UseFlagDisplay.sort_combined) > else: Sorry, Zac, I somehow missed this one... too busy with my head burried in twisted test fixes and new deps... Looks fine :) -- Brian Dolbec
Re: [gentoo-portage-dev] [PATCH] pkg_use_display: show masked/forced state of USE_EXPAND flags (bug 490562)
On Fri, Mar 31, 2017 at 1:05 PM, Brian Dolbecwrote: > On Wed, 22 Mar 2017 09:32:36 -0700 > Zac Medico wrote: > >> Fix pkg_use_display to test if the prefixed flag is in use.force or >> use.mask, rather than the unprefixed flag. >> >> X-Gentoo-bug: 490562 >> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=490562 > > Sorry, Zac, I somehow missed this one... too busy with my head burried > in twisted test fixes and new deps... > > Looks fine :) Thanks, pushed: https://gitweb.gentoo.org/proj/portage.git/commit/?id=09ee3124256c2bb0785e246533b62d310d54082e -- Thanks, Zac
[gentoo-portage-dev] [PATCH] depgraph: trigger slot operator rebuilds via _complete_graph (bug 614390)
Fix _complete_graph to trigger rebuilds of parent packages when they pull in installed packages that had already been scheduled for rebuild by the previous calculation. X-Gentoo-bug: 614390 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=614390 --- pym/_emerge/depgraph.py| 15 +++ .../resolver/test_slot_operator_complete_graph.py | 141 + 2 files changed, 156 insertions(+) create mode 100644 pym/portage/tests/resolver/test_slot_operator_complete_graph.py diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 04e724d..8a614c4 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -6649,6 +6649,21 @@ class depgraph(object): # will be appropriately reported as a slot collision # (possibly solvable via backtracking). pkg = matches[-1] # highest match + + if (self._dynamic_config._allow_backtracking and + not self._want_installed_pkg(pkg) and (dep.atom.soname or ( + dep.atom.package and dep.atom.slot_operator_built))): + # If pkg was already scheduled for rebuild by the previous + # calculation, then pulling in the installed instance will + # trigger a slot conflict that may go unsolved. Therefore, + # trigger a rebuild of the parent if appropriate. + dep.child = pkg + new_dep = self._slot_operator_update_probe(dep) + if new_dep is not None: + self._slot_operator_update_backtrack( + dep, new_dep=new_dep) + continue + if not self._add_pkg(pkg, dep): return 0 if not self._create_graph(allow_unsatisfied=True): diff --git a/pym/portage/tests/resolver/test_slot_operator_complete_graph.py b/pym/portage/tests/resolver/test_slot_operator_complete_graph.py new file mode 100644 index 000..1d59bce --- /dev/null +++ b/pym/portage/tests/resolver/test_slot_operator_complete_graph.py @@ -0,0 +1,141 @@ +# Copyright 2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import ( + ResolverPlayground, + ResolverPlaygroundTestCase, +) + +class SlotOperatorCompleteGraphTestCase(TestCase): + + def testSlotOperatorCompleteGraph(self): + + ebuilds = { + "app-misc/meta-pkg-2" : { + "EAPI": "6", + "DEPEND": "=app-misc/B-2 =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-2", + "RDEPEND": "=app-misc/B-2 =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-2", + }, + + "app-misc/meta-pkg-1" : { + "EAPI": "6", + "DEPEND": "=app-misc/B-1 =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-1", + "RDEPEND": "=app-misc/B-1 =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-1", + }, + + "app-misc/B-1" : { + "EAPI": "6", + "DEPEND": "dev-libs/foo:=", + "RDEPEND": "dev-libs/foo:=", + }, + + "app-misc/B-2" : { + "EAPI": "6", + "DEPEND": "dev-libs/foo:=", + "RDEPEND": "dev-libs/foo:=", + }, + + "app-misc/C-1" : { + "EAPI": "6", + "DEPEND": "dev-libs/foo:= app-misc/B", + "RDEPEND": "dev-libs/foo:= app-misc/B", + }, + + "app-misc/C-2" : { + "EAPI": "6", + "DEPEND": "dev-libs/foo:= app-misc/B", + "RDEPEND": "dev-libs/foo:= app-misc/B", + }, + + "app-misc/D-1" : { + "EAPI": "6", + "DEPEND": "dev-libs/foo:=", + "RDEPEND": "dev-libs/foo:=", + }, + + "app-misc/D-2" : { + "EAPI": "6", + "DEPEND": "dev-libs/foo:=", +
Re: [gentoo-portage-dev] [PATCH] depgraph: trigger slot operator rebuilds via _complete_graph (bug 614390)
On Fri, 31 Mar 2017 21:11:41 -0700 Zac Medicowrote: > Fix _complete_graph to trigger rebuilds of parent packages when they > pull in installed packages that had already been scheduled for rebuild > by the previous calculation. > > X-Gentoo-bug: 614390 > X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=614390 > --- > pym/_emerge/depgraph.py| 15 +++ > .../resolver/test_slot_operator_complete_graph.py | 141 > + 2 files changed, 156 insertions(+) > create mode 100644 > pym/portage/tests/resolver/test_slot_operator_complete_graph.py > > diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py > index 04e724d..8a614c4 100644 > --- a/pym/_emerge/depgraph.py > +++ b/pym/_emerge/depgraph.py > @@ -6649,6 +6649,21 @@ class depgraph(object): > # will be appropriately reported as > a slot collision # (possibly solvable via backtracking). > pkg = matches[-1] # highest match > + > + if > (self._dynamic_config._allow_backtracking and > + not > self._want_installed_pkg(pkg) and (dep.atom.soname or ( > + dep.atom.package and > dep.atom.slot_operator_built))): > + # If pkg was already > scheduled for rebuild by the previous > + # calculation, then pulling > in the installed instance will > + # trigger a slot conflict > that may go unsolved. Therefore, > + # trigger a rebuild of the > parent if appropriate. > + dep.child = pkg > + new_dep = > self._slot_operator_update_probe(dep) > + if new_dep is not None: > + > self._slot_operator_update_backtrack( > + dep, > new_dep=new_dep) > + continue > + > if not self._add_pkg(pkg, dep): > return 0 > if not > self._create_graph(allow_unsatisfied=True): diff --git > a/pym/portage/tests/resolver/test_slot_operator_complete_graph.py > b/pym/portage/tests/resolver/test_slot_operator_complete_graph.py new > file mode 100644 index 000..1d59bce --- /dev/null > +++ b/pym/portage/tests/resolver/test_slot_operator_complete_graph.py > @@ -0,0 +1,141 @@ > +# Copyright 2017 Gentoo Foundation > +# Distributed under the terms of the GNU General Public License v2 > + > +from portage.tests import TestCase > +from portage.tests.resolver.ResolverPlayground import ( > + ResolverPlayground, > + ResolverPlaygroundTestCase, > +) > + > +class SlotOperatorCompleteGraphTestCase(TestCase): > + > + def testSlotOperatorCompleteGraph(self): > + > + ebuilds = { > + "app-misc/meta-pkg-2" : { > + "EAPI": "6", > + "DEPEND": "=app-misc/B-2 > =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-2", > + "RDEPEND": "=app-misc/B-2 > =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-2", > + }, > + > + "app-misc/meta-pkg-1" : { > + "EAPI": "6", > + "DEPEND": "=app-misc/B-1 > =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-1", > + "RDEPEND": "=app-misc/B-1 > =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-1", > + }, > + > + "app-misc/B-1" : { > + "EAPI": "6", > + "DEPEND": "dev-libs/foo:=", > + "RDEPEND": "dev-libs/foo:=", > + }, > + > + "app-misc/B-2" : { > + "EAPI": "6", > + "DEPEND": "dev-libs/foo:=", > + "RDEPEND": "dev-libs/foo:=", > + }, > + > + "app-misc/C-1" : { > + "EAPI": "6", > + "DEPEND": "dev-libs/foo:= > app-misc/B", > + "RDEPEND": "dev-libs/foo:= > app-misc/B", > + }, > + > + "app-misc/C-2" : { > + "EAPI": "6", > + "DEPEND": "dev-libs/foo:= > app-misc/B", > + "RDEPEND": "dev-libs/foo:= > app-misc/B", > + }, > + > + "app-misc/D-1" : { > + "EAPI": "6", > + "DEPEND": "dev-libs/foo:=", > + "RDEPEND": "dev-libs/foo:=", > + }, > + > + "app-misc/D-2" : { > +
Re: [gentoo-portage-dev] [PATCH] depgraph: trigger slot operator rebuilds via _complete_graph (bug 614390)
On Fri, Mar 31, 2017 at 10:06 PM, Brian Dolbecwrote: > On Fri, 31 Mar 2017 21:11:41 -0700 > Zac Medico wrote: > >> Fix _complete_graph to trigger rebuilds of parent packages when they >> pull in installed packages that had already been scheduled for rebuild >> by the previous calculation. >> >> X-Gentoo-bug: 614390 >> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=614390 >> --- >> pym/_emerge/depgraph.py| 15 +++ >> .../resolver/test_slot_operator_complete_graph.py | 141 >> + 2 files changed, 156 insertions(+) >> create mode 100644 >> pym/portage/tests/resolver/test_slot_operator_complete_graph.py >> > > looks good. I look forward to getting less conflicts with this... Thanks, pushed: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a83bb83909c5a6ac232c8eb5931b28027f4175af -- Thanks, Zac