Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#17205 closed defect (fixed)

python_select 0.1_4 symlinks

Reported by: bryan@… Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: raimue (Rainer Müller), jannis@…
Port: python_select

Description

Running python_select more than once will cause the "Current" version symlink to nest the other currently installed MacPorts versions of python into the version of python initially selected. (Sorry for the poor description. I couldn't think of how to correctly phrase this.)

Steps to reproduce the problem:

  1. Install the python24, python25, and python_select ports.
  2. Run python_select python24 to select python24 as the current version. This will create the necessary symlinks in $prefix/bin and $prefix/man and the correct "Headers", "Resources", and "Python" symlinks in $prefix/Library/Frameworks/Python.framework. It will also correctly create a symlink named "Current" in that same path under the "Versions" directory. So far so good.
  3. Run python_select python25 to switch to python25 as the current version. The bin and man symlinks are correctly created. However, the "Headers" and "Resources" symlinks are still pointing to the python24 version in $prefix/Library/Frameworks/Python.framework. Furthermore, if you look inside the "Versions" directory, you'll see that the "Current" symlink is still pointing to the python24 version. Also, you'll see the 2.5 version symlinked inside the 2.4 version's directory.

I hope that all of that made sense. If you were to first select the python25 version followed by then selecting the python24 version, the same thing happens except the current version would remain 2.5 and a symlink to 2.4 would be inside the 2.5 directory.

Of course the easy way around this is to run "python_select python25-apple" prior to selecting any of the MacPorts supplied versions of python which will remove the offending symlinks. But really, this could probably use a patch. I can think of a few different ways to fix the problem and would have submited a patch, but I wasn't sure how the package maintainer would prefer to fix the problem.

Change History (7)

comment:1 Changed 16 years ago by raimue (Rainer Müller)

Owner: changed from macports-tickets@… to raimue@…
Status: newassigned

Okay, the problem is that python_select is following symlinks instead of overwriting them. I will look into the issue.

comment:2 Changed 16 years ago by bryan@…

Also, has there been any discussion about scripts installed into bin when installing any of the py- ports? For example, if I install both py-ipython and py25-ipython, only one ipython script can be located in bin at a time. Should python_select possibly also deactivate all currently installed and active ports of a particular version of python and then activate all currently installed but deactivated ports of the version of python being switched to? But this would also entail keeping track of all of the scripts for any python ports installed.

comment:3 in reply to:  2 Changed 16 years ago by raimue (Rainer Müller)

Replying to bryan@…: This is a request to extend the functionality of python_select. I would prefer to have a generic alternatives management implemented in base.

comment:4 Changed 16 years ago by jannis@…

Cc: jannis@… added

Cc Me!

comment:5 Changed 16 years ago by raimue (Rainer Müller)

Fixed for contrib/select in r43711.

comment:6 Changed 16 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: assignedclosed

Fixed with python_select 0.2 in r44662.

comment:7 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.