On Mar 9, 2009, at 21:50, Bradley Giesbrecht wrote:

On Mar 9, 2009, at 3:44 PM, Ryan Schmidt wrote:

There are the docbook xml ports now which print a message saying I need to run some command I'm never going to remember if I ever uninstall the port.

I'm not sure what you are meaning here

I mean that when you install e.g. the port "docbook-xml-4.5" the following message is displayed to the user:

######################################################################
# As MacPorts does not currently have a post-deactivate hook,
# you will need to ensure that you manually remove the catalog
# entry for this port when you uninstall it.  To do so, run
# "xmlcatmgr remove nextCatalog /opt/local/share/xml/docbook/4.5/ catalog.xml".
######################################################################

If MacPorts had a post-deactivate hook, the port could do this task itself and not need to bother the user with it. I know I sure as heck am not going to remember what command some port asked me to run when I uninstall it, since it's probably been months or years since I installed it.

but if there is anything that a user NEEDS to do after uninstalling a port maybe the port uninstall command could pause with the message and wait for confirmation, bailing is the user clicks [n].

We can't do that today because port is not interactive (except in interactive mode, but that still doesn't allow individual portfiles to interact with the user). Anyway that's also not the solution I would want; I would want proper deactivate and uninstall hooks.


This isn't a big deal but some people may do something silly like "port uninstall installed echo p5-*" not knowing that it's going to uninstall everything.
Ok, that was me :) Trying to figure out how to chain port commands.

There is no chain of port commands. You only get one action command, but it can then act on any number of ports. In the above case, the action you asked for is "uninstall", and you asked for it to act on the pseudoport "installed" (which expands to the list of all installed ports), and the nonexistent port "echo", and all ports matching "p5-*". Here is the usage for the port command, from its manpage:

port [-vdqfonRusbckixpt] [-D portdir] [-F cmdfile] [action] [actionflags]
          [[portname | pseudo-portname | port-url]]
          [...@version] [+/-variant ...] ... [option=value ...]]

Part of the confusion arises because there are some keywords (for example "installed" and "outdated") which are both actions and pseudoports. As an action, "installed" shows you the versions and variants of all ports you have installed, and "outdated" shows you what ports are outdated along with their current and the newer version that's now available. As pseudoports, "installed" expands to the list of installed ports, and "outdated" to the list of outdated ports. This lets you do things like "port upgrade outdated" (upgrade all outdated ports) or "port info installed" (get info on every installed port).


_______________________________________________
macports-users mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

Reply via email to