Removing mercurial's pkg installation from my MacOSX and replacing it with the corresponding MacPorts port

David Champion dgc at uchicago.edu
Thu Jun 16 10:26:08 UTC 2011


* On 15 Jun 2011, Marko K??ning wrote: 
> Hi,
> 
> how do I safely remove hg from my MacOSX without leaving any traces? (Mercurial had previously been installed via a mpkg from http://mercurial.berkwood.com!)
> 
> (I want to switch over to MacPorts which would automatically take care of any updates.)

To see what mercurial packages are installed:

$ pkgutil --pkgs | grep mercurial

To remove the files for a package:

$ pkgutil --files org.pythonmac.mercurial-platlib-py2.6-macosx10.6 \
	| sort -r \
	| perl -ne 'chomp and unlink or rmdir'

(Substitute whichever package you're removing.)  The pkgutil command
alone without the perl command will list which files will be removed.
The sort command is necessary to position directories after their
contents, so that rmdir can remove them.  This command will not remove
directories that still have contents.

If there is any overlap between the Berkwood package contents and the
MacPorts package contents, this could break the MacPorts package.  You
should uninstall it from MacPorts before doing this, then reinstall
afterwards.

No warranty provided, no liability accepted, etc.  Use at own risk.

-- 
David Champion • dgc at uchicago.edu • IT Services • University of Chicago


More information about the Mercurial mailing list