Cleaning up during uninstall and submitting Portfile

David Osguthorpe david.osguthorpe at gmail.com
Thu Apr 2 07:34:51 PDT 2009


On Thu, Apr 02, 2009 at 04:11:14AM -0600, Ryan Schmidt wrote:
> On Apr 2, 2009, at 04:51, Anand Buddhdev wrote:
> 
> Oh yes, understood. But sorry, no, there is no post-uninstall hook.  
> There are several ports where this would be useful, but nobody has  
> written it yet.
> 

what about the pkg_uninstall hook - this has existed for a long while
- although I see in registry2.0 somebody has commented this section

# pkg_uninstall isn't used anywhere as far as I can tell and I intend to add

of course it isnt used anywhere - you need to define a pkg_uninstall procedure
in the Portfile

the other fixup needed is an encoding of the procedure as defined in the Portfile
before it can be stored in the registry file so that it works after reading from the registry
- I needed a fixup to the proc_disasm procedure to map \n to \\n in the procedure body
to get this to work

append p [string map { \n \\n } [info body $pname] ]

with this I have had pkg_uninstall working for a few years - unfortunately the name change
from darwinports to macports made life difficult for me (running on Panther at the time
and only recently upgrading to Tiger because of features I needed that only worked
in Panther) and hence had no desire to upgrade that system
- only now with a new machine did I install the new macports

David



More information about the macports-dev mailing list