Re: [gentoo-portage-dev] [PATCH] depgraph: fix backtracking for slot operator rebuilds (bug 612042)

2017-03-08 Thread Zac Medico
On Wed, Mar 8, 2017 at 10:56 AM, Brian Dolbec  wrote:
>
> looks good :)
>
> --
> Brian Dolbec 
>
>

Thanks, merged:


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



Re: [gentoo-portage-dev] [PATCH] use_reduce: reserve missing_white_space_check for invalid tokens (bug 611838)

2017-03-08 Thread Zac Medico
On Wed, Mar 8, 2017 at 10:50 AM, Brian Dolbec  wrote:
> On Mon,  6 Mar 2017 12:51:08 -0800
> Zac Medico  wrote:
>
>> Since it's possible for a URI to contain parenthesis, only call
>> missing_white_space_check for tokens that fail to validate with
>> token_class. The missing_white_space_check function only serves
>> to clarify exception messages, so it must not be allowed to
>> reject valid tokens.
>> ---
>>  pym/portage/dep/__init__.py | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
>> index 968ff5b..6ff6adc 100644
>> --- a/pym/portage/dep/__init__.py
>> +++ b/pym/portage/dep/__init__.py
>> @@ -677,8 +677,6 @@ def use_reduce(depstr, uselist=[], masklist=[],
>> matchall=False, excludeall=[], i need_simple_token = True
>>   stack[level].append(token)
>>   else:
>> - missing_white_space_check(token, pos)
>> -
>>   if need_bracket:
>>   raise InvalidDependString(
>>   _("expected: '(', got: '%s',
>> token %s") % (token, pos+1)) @@ -698,12 +696,14 @@ def
>> use_reduce(depstr, uselist=[], masklist=[], matchall=False,
>> excludeall=[], i token = token_class(token, eapi=eapi,
>> is_valid_flag=is_valid_flag) except InvalidAtom as e:
>> +
>> missing_white_space_check(token, pos) raise InvalidDependString(
>>   _("Invalid
>> atom (%s), token %s") \ % (e, pos+1), errors=(e,))
>>   except SystemExit:
>>   raise
>>   except Exception as e:
>> +
>> missing_white_space_check(token, pos) raise InvalidDependString(
>>   _("Invalid
>> token '%s', token %s") % (token, pos+1))
>
> looks good :)

Thanks, merged:

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



Re: [gentoo-portage-dev] [PATCH v2] emerge: auto-enable --with-bdeps if --usepkg is not enabled (bug 598444)

2017-03-08 Thread Zac Medico
On Wed, Mar 8, 2017 at 10:48 AM, Brian Dolbec  wrote:
> On Sun,  5 Mar 2017 00:40:25 -0800
> Zac Medico  wrote:
>
>> It's useful to automatically enable --with-bdeps so that @world
>> updates will update all packages that are not eligible for removal by
>> emerge --depclean. However, many users of binary packages do not want
>> unnecessary build time dependencies installed, therefore do not
>> auto-enable --with-bdeps for installation actions when the --usepkg
>> option is enabled.
>>
>> A new --with-bdeps-auto= option is provided, making it possible
>> to enable or disable the program logic that causes --with-bdeps to be
>> automatically enabled. Use --with-bdeps-auto=n to prevent --with-bdeps
>> from being automatically enabled for installation actions. This is
>> useful for some rare cases in which --with-bdeps triggers unsolvable
>> dependency conflicts (and putting --with-bdeps=n in
>> EMERGE_DEFAULT_OPTS would cause undesirable --depclean behavior).
>>
>> X-Gentoo-bug: 598444
>> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=598444
>> ---
>> [PATCH v2] adds a --with-bdeps-auto= option which is useful for
>> some rare cases in which --with-bdeps triggers unsolvable dependency
>> conflicts
>>
>>  man/emerge.1 |  37 +++-
>>  pym/_emerge/create_depgraph_params.py|   5 +
>>  pym/_emerge/depgraph.py  |   4 +-
>>  pym/_emerge/main.py  |   5 +
>>  pym/portage/tests/resolver/ResolverPlayground.py |   5 +
>>  pym/portage/tests/resolver/test_bdeps.py | 215
>> +++ 6 files changed, 266 insertions(+), 5
>> deletions(-) create mode 100644
>
> Looks fine, merge please :)

Thanks merged:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=852c729bdef3d4c2e2d459a43dc21f0a05dfa2ba

-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH] depgraph: fix backtracking for slot operator rebuilds (bug 612042)

2017-03-08 Thread Brian Dolbec
On Wed,  8 Mar 2017 03:09:06 -0800
Zac Medico  wrote:

> Fix package selection logic to avoid pulling in undesirable
> rebuilds/updates during backtracking for slot operator rebuilds.
> The undesirable rebuilds/updates have sent some calculations off
> course, by triggering more and more rebuilds/updates with each
> backtracking run.
> 
> In order to solve the problem, make various adjustments to the
> package selection logic so that installed packages are preferred
> over rebuilds/updates when appropriate. Also update unit tests
> to work with these adjustments.
> 
> Fixes: 5842e87872fd ("Fix slot operator handling bug")
> X-Gentoo-bug: 612042
> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=612042
> ---
>  pym/_emerge/depgraph.py  | 11
> +-- .../resolver/soname/test_slot_conflict_reinstall.py
> | 16 +++-
> pym/portage/tests/resolver/test_slot_abi.py  | 12
> +--- pym/portage/tests/resolver/test_slot_conflict_rebuild.py
> |  8 +++- 4 files changed, 36 insertions(+), 11 deletions(-)
> 
> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
> index ce0fde1..3ba631e 100644
> --- a/pym/_emerge/depgraph.py
> +++ b/pym/_emerge/depgraph.py
> @@ -2304,7 +2304,7 @@ class depgraph(object):
>   # Check for slot update first, since
> we don't want to # trigger reinstall of the child package when a newer
>   # slot will be used instead.
> - if rebuild_if_new_slot:
> + if rebuild_if_new_slot and
> dep.want_update: new_dep = self._slot_operator_update_probe(dep,
>   new_child_slot=True)
>   if new_dep is not None:
> @@ -6241,7 +6241,7 @@ class depgraph(object):
>   if
> highest_installed is None or pkg.version > highest_installed.version:
> highest_installed = pkg 
> - if highest_installed:
> + if highest_installed and
> self._want_update_pkg(parent, highest_installed): non_installed =
> [pkg for pkg in matched_packages \ if not pkg.installed and
> pkg.version > highest_installed.version] 
> @@ -6285,11 +6285,18 @@ class depgraph(object):
>   built_timestamp !=
> installed_timestamp: return built_pkg, existing_node
>  
> + inst_pkg = None
>   for pkg in matched_packages:
> + if pkg.installed:
> + inst_pkg = pkg
>   if pkg.installed and pkg.invalid:
>   matched_packages = [x for x
> in \ matched_packages if x is not pkg]
>  
> + if (inst_pkg is not None and parent is not
> None and
> + not self._want_update_pkg(parent,
> inst_pkg)):
> + return inst_pkg, existing_node
> +
>   if avoid_update:
>   for pkg in matched_packages:
>   if pkg.installed and
> self._pkg_visibility_check(pkg, autounmask_level): diff --git
> a/pym/portage/tests/resolver/soname/test_slot_conflict_reinstall.py
> b/pym/portage/tests/resolver/soname/test_slot_conflict_reinstall.py
> index f474761..f715444 100644 ---
> a/pym/portage/tests/resolver/soname/test_slot_conflict_reinstall.py
> +++
> b/pym/portage/tests/resolver/soname/test_slot_conflict_reinstall.py
> @@ -251,13 +251,27 @@ class
> SonameSlotConflictReinstallTestCase(TestCase): success = True,
> mergelist = [ '[binary]app-misc/B-2',
> + '[binary]app-misc/A-2',
> + ]
> + ),
> + ResolverPlaygroundTestCase(
> + ["@world"],
> + options = {
> + "--ignore-soname-deps": "n",
> + "--usepkgonly": True,
> + "--update": True,
> + "--deep": True,
> + },
> + success = True,
> + mergelist = [
> + '[binary]app-misc/B-2',
>   '[binary]app-misc/C-1',
>   '[binary]app-misc/A-2',
>   ]
>   ),
>   )
>  
> - world = []
> + world = ['app-misc/A']
>  
>   playground = ResolverPlayground(binpkgs=binpkgs,
>   installed=installed, world=world,
> debug=False) diff --git a/pym/portage/tests/resolver/test_slot_abi.py
> 

Re: [gentoo-portage-dev] [PATCH] use_reduce: reserve missing_white_space_check for invalid tokens (bug 611838)

2017-03-08 Thread Brian Dolbec
On Mon,  6 Mar 2017 12:51:08 -0800
Zac Medico  wrote:

> Since it's possible for a URI to contain parenthesis, only call
> missing_white_space_check for tokens that fail to validate with
> token_class. The missing_white_space_check function only serves
> to clarify exception messages, so it must not be allowed to
> reject valid tokens.
> ---
>  pym/portage/dep/__init__.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
> index 968ff5b..6ff6adc 100644
> --- a/pym/portage/dep/__init__.py
> +++ b/pym/portage/dep/__init__.py
> @@ -677,8 +677,6 @@ def use_reduce(depstr, uselist=[], masklist=[],
> matchall=False, excludeall=[], i need_simple_token = True
>   stack[level].append(token)  
>   else:
> - missing_white_space_check(token, pos)
> -
>   if need_bracket:
>   raise InvalidDependString(
>   _("expected: '(', got: '%s',
> token %s") % (token, pos+1)) @@ -698,12 +696,14 @@ def
> use_reduce(depstr, uselist=[], masklist=[], matchall=False,
> excludeall=[], i token = token_class(token, eapi=eapi,
> is_valid_flag=is_valid_flag) except InvalidAtom as e:
> +
> missing_white_space_check(token, pos) raise InvalidDependString(
>   _("Invalid
> atom (%s), token %s") \ % (e, pos+1), errors=(e,))
>   except SystemExit:
>   raise
>   except Exception as e:
> +
> missing_white_space_check(token, pos) raise InvalidDependString(
>   _("Invalid
> token '%s', token %s") % (token, pos+1)) 

looks good :)

-- 
Brian Dolbec 




Re: [gentoo-portage-dev] [PATCH v2] emerge: auto-enable --with-bdeps if --usepkg is not enabled (bug 598444)

2017-03-08 Thread Brian Dolbec
On Sun,  5 Mar 2017 00:40:25 -0800
Zac Medico  wrote:

> It's useful to automatically enable --with-bdeps so that @world
> updates will update all packages that are not eligible for removal by
> emerge --depclean. However, many users of binary packages do not want
> unnecessary build time dependencies installed, therefore do not
> auto-enable --with-bdeps for installation actions when the --usepkg
> option is enabled.
> 
> A new --with-bdeps-auto= option is provided, making it possible
> to enable or disable the program logic that causes --with-bdeps to be
> automatically enabled. Use --with-bdeps-auto=n to prevent --with-bdeps
> from being automatically enabled for installation actions. This is
> useful for some rare cases in which --with-bdeps triggers unsolvable
> dependency conflicts (and putting --with-bdeps=n in
> EMERGE_DEFAULT_OPTS would cause undesirable --depclean behavior).
> 
> X-Gentoo-bug: 598444
> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=598444
> ---
> [PATCH v2] adds a --with-bdeps-auto= option which is useful for
> some rare cases in which --with-bdeps triggers unsolvable dependency
> conflicts
> 
>  man/emerge.1 |  37 +++-
>  pym/_emerge/create_depgraph_params.py|   5 +
>  pym/_emerge/depgraph.py  |   4 +-
>  pym/_emerge/main.py  |   5 +
>  pym/portage/tests/resolver/ResolverPlayground.py |   5 +
>  pym/portage/tests/resolver/test_bdeps.py | 215
> +++ 6 files changed, 266 insertions(+), 5
> deletions(-) create mode 100644

Looks fine, merge please :)

-- 
Brian Dolbec