Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 652938

Summary: sys-apps/portage-2.3.28: binary packages built against older subslot trigger downgrade of installed package
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: esigra
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 155723, 651804    

Description Zac Medico gentoo-dev 2018-04-10 20:53:08 UTC
When installing binary packages, without --deep, binary packages built against an older subslot can trigger downgrade of an installed package. This happens because the depgraph _slot_operator_trigger_reinstalls method only calls _slot_operator_update_probe when dep.want_update is True, and dep.want_update may be False for a binary package that was built against an older subslot. This patch solves the problem:

> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
> index 160ea5e94..54f00b43d 100644
> --- a/pym/_emerge/depgraph.py
> +++ b/pym/_emerge/depgraph.py
> @@ -3111,7 +3111,8 @@ class depgraph(object):
>  		deep = self._dynamic_config.myparams.get("deep", 0)
>  		update = "--update" in self._frozen_config.myopts
>  
> -		dep.want_update = (not self._dynamic_config._complete_mode and
> +		dep.want_update = not pkg.installed or (
> +			not self._dynamic_config._complete_mode and
>  			(arg_atoms or update) and
>  			not self._too_deep(depth))
>
Comment 2 Larry the Git Cow gentoo-dev 2018-04-12 02:45:39 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=600b329949f8770fe2962987ee97567b65393c7e

commit 600b329949f8770fe2962987ee97567b65393c7e
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-04-10 21:29:44 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-04-12 02:43:47 +0000

    _slot_operator.._reinstalls: probe binpkg rebuild (bug 652938)
    
    If the parent is not installed, check if it needs to be rebuilt against
    an installed instance, since otherwise it could trigger downgrade of
    an installed instance.
    
    Bug: https://bugs.gentoo.org/652938
    Reviewed-by: Manuel RĂ¼ger <mrueg@gentoo.org>

 pym/_emerge/depgraph.py                            | 10 ++++-
 .../tests/resolver/test_slot_operator_rebuild.py   | 45 +++++++++++++++++++++-
 2 files changed, 51 insertions(+), 4 deletions(-)}
Comment 3 Zac Medico gentoo-dev 2018-07-02 18:51:28 UTC
Fixed in portage-2.3.40-r1.