[MacPorts] #17477: Integrate *_select tools into port
#17477: Integrate *_select tools into port ------------------------------+--------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Keywords: select | Port: ------------------------------+--------------------------------------------- Currently there are two *_select ports, gcc_select and python_select, and an increasing need for more (perl, ruby, others?). This would work better if they were brought into just one tool, and as [http://lists.macosforge.org/pipermail/macports- users/2008-December/012652.html Rainer points out] putting them into port itself make sense. -- Ticket URL: <http://trac.macports.org/ticket/17477> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17477: Integrate *_select tools into port ------------------------------+--------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Keywords: select | Port: ------------------------------+--------------------------------------------- Changes (by perry@…): * cc: perry@… (added) Comment: I've attached a patch that integrates some of the *_select tools' functionality in port. The syntax is `port select <module> <action> <options>`, with the following actions currently available: list, set {{{ perry@phoenix ~/src/macports-trunk/base/src/port $ sudo port select python list Available Versions: none python25 python25-apple perry@phoenix ~/src/macports-trunk/base/src/port $ python Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information.
^D perry@phoenix ~/src/macports-trunk/base/src/port $ sudo port select python set python25 Selecting version python25 for python perry@phoenix ~/src/macports-trunk/base/src/port $ python Python 2.5.2 (r252:60911, Dec 6 2008, 18:32:57) [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type "help", "copyright", "credits" or "license" for more information. ^D }}}
-- Ticket URL: <http://trac.macports.org/ticket/17477#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17477: Integrate *_select tools into port ------------------------------+--------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Keywords: select | Port: ------------------------------+--------------------------------------------- Comment(by raimue@…): Perry, your patch looks good. But wouldn't it make more sense to have this in port1.0 or macports1.0 in the API, e.g. for use in the MacPorts.framework if anyone ever gets back to it? Some additional thoughts about the syntax, I would prefer: {{{ port select [--set|--list] <group> }}} -- Ticket URL: <http://trac.macports.org/ticket/17477#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17477: Integrate *_select tools into port ------------------------------+--------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Keywords: select | Port: ------------------------------+--------------------------------------------- Comment(by kngspook@…): Replying to [comment:2 raimue@…]:
Some additional thoughts about the syntax, I would prefer: {{{ port select [--set|--list] <group> }}}
Well, that might imply/be interpreted by a lot of people that "--set" and "--list" are optional. If we go that route, then maybe some additional logic should be in place that basically states: * if they give only `port select something`, then treat it like a list command * if they give `port select something valid-selection`, then treat it like a set command * if they give `port select something invalid-selection`, then show an error stating as such and give them the list of valid picks. -- Ticket URL: <http://trac.macports.org/ticket/17477#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17477: Integrate *_select tools into port ------------------------------+--------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Keywords: select | Port: ------------------------------+--------------------------------------------- Comment(by perry@…): Replying to [comment:4 kngspook@…]:
Replying to [comment:2 raimue@…]:
Some additional thoughts about the syntax, I would prefer: {{{ port select [--set|--list] <group> }}}
Well, that might imply/be interpreted by a lot of people that "--set" and "--list" are optional. If we go that route, then maybe some additional logic should be in place that basically states:
* if they give only `port select something`, then treat it like a list command * if they give `port select something valid-selection`, then treat it like a set command * if they give `port select something invalid-selection`, then show an error stating as such and give them the list of valid picks.
Both suggestions seem reasonable. "--set|--list" seems more in line with the other port commands (and consistency is certainly good :)). For now, I'll implement the logic you brought up. It makes sense to me, and if users find it confusing, we can always tweak it then. Also, I'll move the code to port1.0 -- after the discussion in IRC, it seems like that is the most reasonable place to put it (factoring in the whole reality differing from ideals ;)). One additional command that I'm thinking of implementing is to show the currently selected version (the current *_select tools don't show this). I'll likely try to add this command after implementing the above suggestions. -- Ticket URL: <http://trac.macports.org/ticket/17477#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17477: Integrate *_select tools into port ------------------------------+--------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Keywords: select | Port: ------------------------------+--------------------------------------------- Comment(by perry@…): I've changed the syntax to "--list|--set|--show" and added some of the logic (e.g., if no commands are specified, port select assumes the show command is intended. The show command has not been implemented yet, but --list and --set work. You can see the changes here: http://trac.macports.org/browser/users/perry/base-select {{{ perry@phoenix ~/src/macports-users-perry/base-select $ sudo port select Error: port select [--list|--set|--show] [<group> [<version]] perry@phoenix ~/src/macports-users-perry/base-select $ sudo port select python Error: The 'show' command failed. Enable debug mode to see why. perry@phoenix ~/src/macports-users-perry/base-select $ sudo port select --list python Available Versions: base none python25 python25-apple perry@phoenix ~/src/macports-users-perry/base-select $ sudo port select python python25 Selecting 'python25' for 'python' succeeded. 'python25' is now active. perry@phoenix ~/src/macports-users-perry/base-select $ sudo port select --set python python25-apple Selecting 'python25-apple' for 'python' succeeded. 'python25-apple' is now active. perry@phoenix ~/src/macports-users-perry/base-select $ sudo port select --set python foo Selecting 'foo' for 'python' failed. Enable debug mode to see why. }}} -- Ticket URL: <http://trac.macports.org/ticket/17477#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17477: Integrate *_select tools into port ------------------------------+--------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Keywords: select | Port: ------------------------------+--------------------------------------------- Comment(by perry@…): I forgot to mention that I created a proc in macports1.0 called mportselect. It returns "" on error (using ui_debug to indicate the nature of the error). The only two files that have been modified are port/port.tcl and macports1.0/macports.tcl. -- Ticket URL: <http://trac.macports.org/ticket/17477#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17477: Integrate *_select tools into port ------------------------------+--------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Keywords: select | Port: ------------------------------+--------------------------------------------- Comment(by perry@…): For the sake of completeness (mostly as a proof of concept), I've quickly implemented --show in r44056. It needs to be written ASAP (for reasons that will be obvious when you look at the code ;)). The main problem is that the currently selected version is not logged when using a *_select tool (and of course port select). Using the current method I've implemented won't work if (1) more than one version symlinks to the same file or (2) there are no symlinks (e.g., 'none' for the 'python' group). We should standardize how the currently selected version for each group is logged. One thought is have a symlink in the confpath that points to the currently selected version. As an example: {{{ perry@phoenix /opt/local/etc/select/python $ ls -l total 20 -rw-r--r-- 2 root admin 310 2008-12-16 20:34 base -rw-r--r-- 2 root admin 24 2008-12-16 20:34 none -rw-r--r-- 2 root admin 344 2008-12-06 18:35 python25 -rw-r--r-- 2 root admin 151 2008-12-16 20:34 python25-apple lrwxr-xr-x 1 root admin 8 2008-12-19 23:24 selected -> python25 }}} -- Ticket URL: <http://trac.macports.org/ticket/17477#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17477: Integrate *_select tools into port ------------------------------+--------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Keywords: select | Port: ------------------------------+--------------------------------------------- Comment(by perry@…): Since my last update, I've integrated Rainer's latest changes to *_select (specifically --show now uses the 'current' symlink to determine the selected version) and added more specific error messages to port select (r44676). After more testing, I'll likely merge the code into trunk/base since all of the essential functionality seems to be there now. -- Ticket URL: <http://trac.macports.org/ticket/17477#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17477: Integrate *_select tools into port ------------------------------+--------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Keywords: select | Port: ------------------------------+--------------------------------------------- Comment(by perry@…): Merged into trunk/base in r44693. For now I'll leave this ticket open for feedback. If it ends up being inactive for some time, I'll go ahead and close it, assuming all is well ;). -- Ticket URL: <http://trac.macports.org/ticket/17477#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17477: Integrate *_select tools into port -------------------------------+-------------------------------------------- Reporter: blb@… | Owner: macports-tickets@… Type: enhancement | Status: closed Priority: Normal | Milestone: MacPorts 1.8.0 Component: base | Version: 1.7.0 Resolution: fixed | Keywords: select Port: | -------------------------------+-------------------------------------------- Changes (by perry@…): * status: new => closed * resolution: => fixed Comment: Closing. -- Ticket URL: <http://trac.macports.org/ticket/17477#comment:13> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts