Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 683178 - =app-eselect/eselect-python-20171204: "eselect python cleanup" only removes a single stale implementation per invocation
Summary: =app-eselect/eselect-python-20171204: "eselect python cleanup" only removes a...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-12 15:47 UTC by Till Schäfer
Modified: 2019-04-17 12:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Till Schäfer 2019-04-12 15:47:07 UTC
When eselect python cleanup is invoked, it does only clean one stale implementation per invocation. 

Example: 

# eselect python list
Available Python interpreters, in order of preference:
  [1]   python2.7
  [2]   python3.5 (uninstalled)
  [3]   python3.4 (uninstalled)
  [4]   python3.6 (fallback)

# eselect python cleanup

# eselect python list
Available Python interpreters, in order of preference:
  [1]   python3.6
  [2]   python2.7
  [3]   python3.4 (uninstalled)

# eselect python cleanup

# eselect python list
Available Python interpreters, in order of preference:
  [1]   python3.6
  [2]   python2.7
Comment 1 Larry the Git Cow gentoo-dev 2019-04-17 10:47:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/eselect-python.git/commit/?id=cb7db35b2863967c327d76b1f8ec4dc77493ed7b

commit cb7db35b2863967c327d76b1f8ec4dc77493ed7b
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2019-04-17 10:46:33 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2019-04-17 10:47:11 +0000

    Fix mismatched indexes when looping over old impls
    
    Bug: https://bugs.gentoo.org/683178
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 python.eselect.in | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-04-17 10:48:31 UTC
Ok, apparently bash is very silly at removing array elements, and once you start doing that, the element indexes remain the same even though list length shrinks.  Should be fixed now.  Could test 9999* and confirm?
Comment 3 Till Schäfer 2019-04-17 12:16:56 UTC
The live ebuild fixed the issue for me.

(found a backup of a VM that still contains the old versions...)
Comment 4 Larry the Git Cow gentoo-dev 2019-04-17 12:27:51 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79962c3e77dc69df227ba4a25779911b8846d4b7

commit 79962c3e77dc69df227ba4a25779911b8846d4b7
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2019-04-17 12:27:31 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2019-04-17 12:27:47 +0000

    app-eselect/eselect-python: Bump to 20190417
    
    Closes: https://bugs.gentoo.org/683178
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 app-eselect/eselect-python/Manifest                |  1 +
 .../eselect-python/eselect-python-20190417.ebuild  | 40 ++++++++++++++++++++++
 2 files changed, 41 insertions(+)