A few new features for `port`

Ryan Schmidt ryandesign at macports.org
Mon Nov 8 00:01:51 PST 2010


On Nov 8, 2010, at 00:07, Galen Wright-Watson wrote:

> I've a few customizations for the `port` command, and I'm getting tired of patching with each new release, so I'm offering them up for inclusion into the base, should others be interested.

Thanks!

> The attached "port.patch" contains a patch with the changes. If others are interested, what's the next step?
> 
> New feature:
>   The full action doesn't need to be specified on the command line. Instead, enough of the prefix to uniquely specify the action is all that is required (e.g. "port depe ..." instead of "port dependents ...", or "port va ..." instead of "port variants ..."). If the action isn't unique, port lists all the actions it could be and doesn't process the action.
> 
> New commands:
>   active: list active ports (faster than "list active")
>   inactive: list inactive ports (faster than "list inactive")

Note that "port list" doesn't do what you may think it does. See the FAQ for details:

http://trac.macports.org/wiki/FAQ#portlist

I agree with Joshua that we shouldn't add more verbs to MacPorts that duplicate existing functionality. In this case, things like "port echo active" or "port installed inactive" already work.

>   actinact: list installed ports that have active and inactive versions

This is definitely useful; I have a shell script I've been using that does this and it would be great to have it built-in.

>   alldeps: list all dependencies for a port
>   nodependents/nodepts: list installed ports with no dependents
>   nodeps: list ports with no dependencies (faster than "list installed and ! depends:")
>   space/size [-KMB]: show disk space used by an active port, in KiB (-K), MiB (-M), or auto-scaled units (-B).

This would be great; more convenient than running "du -sh /opt/local/var/macports/software/PORT/VERSION"

> Command synonyms:  
>   depts: synonym for dependents
>   files: synonym for contents
>   update: synonym for upgrade
> 
> New command options:
>   contents -s: print size of files in a port along with the file names

Sounds similar to a shell alias I have set up "port ll" which runs "ls -l" on each item of "port contents". Much of the output from "ls -l" I don't really want, but seeing the size is nice, as is seeing where symlinks point to.





More information about the macports-dev mailing list