#36179 closed enhancement (fixed)
Please add port select --summary option
Reported by: | cdeil (Christoph Deil) | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | MacPorts 2.3.0 |
Component: | base | Version: | 2.1.2 |
Keywords: | Cc: | neverpanic (Clemens Lang), KubaO (Kuba Ober), devshashwatpandey@… | |
Port: |
Description
I love how easy it is with port select to switch between versions.
But finding out which of the ports I have installed support port select is tricky. I have to google to find http://stackoverflow.com/questions/8016692/on-macports-what-ports-are-supported-by-port-select and then I see
$ ls /opt/local/etc/select clang cython gcc ipython llvm mysql nosetests pep8 python qt4 scala sphinx $ port select --show gcc The currently selected version for 'gcc' is 'mp-gcc47'. $ port select --show python The currently selected version for 'python' is 'python27'.
Would it be possible to have one command (e.g. called --summary) that shows an overview table:
$ port select --summary Portgroup Selected Options gcc mp-gcc47 none llvm-gcc42 mp-gcc45 mp-gcc47 mp-llvm-gcc42 python python27 none python27 python32 ...
Attachments (8)
Change History (18)
comment:1 follow-up: 7 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Component: | ports → base |
---|
comment:2 Changed 12 years ago by neverpanic (Clemens Lang)
Cc: | cal@… added |
---|
If you know some Tcl (or even if you don't, since it's not too complicated) I'd welcome a patch on this one.
To start, see source:trunk/base/src/macports1.0/macports.tcl@97839:3986-4094#L3986 where this is implemented.
Changed 11 years ago by devshashwatpandey@…
Changed 11 years ago by devshashwatpandey@…
Attachment: | macports.diff added |
---|
comment:4 Changed 11 years ago by devshashwatpandey@…
I have added the --summary option for port select. But, I could not test it properly. Please report any bugs.
comment:6 Changed 11 years ago by neverpanic (Clemens Lang)
Looks good at first sight – unfortunately I can't test right now because my working copy is busy tracking other changes and I don't want to risk mixing them (why don't we use git again? :/).
One thing I noticed is that your changes put set group [lindex $portlist 0]
before the length check of $portlist
. Since lindex
doesn't fail on invalid indices that's not a problem per-se, I just think it would be a little cleaner to move it after the check.
The indentation seems to be a little off in some places, too, but that's just a cosmetic issue.
Everything else seems to be in order – what's the problem with testing it? Don't have any select-capable ports installed? You can just install python_select
or mysql_select
– they won't have anything to select, but they should still show up just fine in your summary output.
comment:7 Changed 11 years ago by nerdling (Jeremy Lavergne)
Replying to ryandesign@…: You can combine those ideas to get the requested feature:
for i in `port -q echo installed and name:_select$`; do port select --list ${i%%_select*}; done
Changed 11 years ago by nerdling (Jeremy Lavergne)
Attachment: | base-select-summary.diff added |
---|
combine previous patches, fix bugs and whitespace
comment:8 Changed 11 years ago by nerdling (Jeremy Lavergne)
I've fixed a bug, and rearranged the code to make a cleaner diff. Please see attached.
Changed 11 years ago by nerdling (Jeremy Lavergne)
Attachment: | base-select-summary.2.diff added |
---|
fix rearranged lines: undefined $commands
Changed 11 years ago by raimue (Rainer Müller)
Attachment: | base-select-summary.3.diff added |
---|
Version 2 of the patch returned one portgroup only, moved the return statement to the correct location
Changed 11 years ago by nerdling (Jeremy Lavergne)
Attachment: | base-select-summary.4.diff added |
---|
formatting
Changed 11 years ago by nerdling (Jeremy Lavergne)
Attachment: | base-select-summary.5.diff added |
---|
pick up raim's version 3 changes
Changed 11 years ago by nerdling (Jeremy Lavergne)
Attachment: | base-select-summary.6.diff added |
---|
calculate row widths
comment:9 Changed 11 years ago by nerdling (Jeremy Lavergne)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Added in r117607.
Thanks!
comment:10 Changed 4 years ago by jmroot (Joshua Root)
Milestone: | → MacPorts 2.3.0 |
---|
To see the select ports that you've already installed, run:
To see the available select ports that you haven't installed yet, run: