Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 298107 - python.eclass: validate_PYTHON_ABIS() should print more detailed error message than "'/usr/bin/python' isn't valid symlink"
Summary: python.eclass: validate_PYTHON_ABIS() should print more detailed error messag...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-23 13:15 UTC by Paweł Hajdan, Jr. (RETIRED)
Modified: 2010-02-06 08:59 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 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2009-12-23 13:15:11 UTC
I just hit this piece of code while upgrading python on an old system:

    # Ensure that /usr/bin/python and /usr/bin/python-config are valid.
    if [[ "$(readlink /usr/bin/python)" != "python-wrapper" ]]; then
        die "'/usr/bin/python' isn't valid symlink"
    fi

Please, could you make the error message tell people what to do? I tracked it down and fixed with "eselect python set 1" in less than a minute, but for an average user this is going to be just frustrating.
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-01-10 17:11:34 UTC
I have added the following eerror messages:
  '/usr/bin/python' is not valid symlink.
  Use `eselect python set ${python_interpreter}` to fix this problem.
Comment 2 Miroslav Rovis 2010-02-05 23:06:35 UTC
(In reply to comment #1)
> I have added the following eerror messages:
>   '/usr/bin/python' is not valid symlink.
>   Use `eselect python set ${python_interpreter}` to fix this problem.
> 

For non-programmers, what does one use instead of the literals "python_interpreter" (which doesn't work) in the command line above?
Thanx.
Comment 3 Miroslav Rovis 2010-02-05 23:11:40 UTC
> For non-programmers, what does one use instead of the literals
> "python_interpreter" (which doesn't work) in the command line above?
> Thanx.
> 
Ouch, it was just:

my_box # eselect python list
Available Python interpreters:
  [1]   python2.6 *
my_box # eselect python set 1
my_box #

:-)
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-02-06 08:59:10 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > I have added the following eerror messages:
> >   '/usr/bin/python' is not valid symlink.
> >   Use `eselect python set ${python_interpreter}` to fix this problem.
> 
> For non-programmers, what does one use instead of the literals
> "python_interpreter" (which doesn't work) in the command line above?

${python_interpreter} means a variable, so you should substitute it with some value.
Example:
eselect python set python3.1