[Pythonmac-SIG] MacEnthon ...

Bob Ippolito bob at redivi.com
Sat Mar 26 01:42:22 CET 2005


On Mar 25, 2005, at 5:57 PM, Robert Kern wrote:

> Bob Ippolito wrote:
>> On Mar 25, 2005, at 1:45 PM, Robert Kern wrote:
>>> So I issue a challenge to the PythonMac masses: Write me an 
>>> uninstaller.  Standalone GUI is a plus, although I can live with a 
>>> CLI script. For now, it only needs to be run by the intrepid 
>>> testers. One ought to be able to uninstall indivdual packages.
>> Is this <http://www.osxgnu.org/software/Utils/OSXGNU/> usable?
>
> No, it assumes things about the naming conventions of the BOM file.

It looked kinda crappy anyway, I was just wondering if you had tried it.

I'm not volunteering to do this, as I don't need it and I have plenty 
of other things to work on.. but here is a brain dump of the procedure 
for uninstalling a package generated by bdist_mpkg (or most anything 
else):

(1) Somehow know the name of all the .pkgs inside, the .mpkg does not 
create a receipt of its own
(2) Pick up the value of the "IFPkgReceiptLocation" key in the 
./Contents/Info.plist of the .pkg
(3) Grab the output of "/usr/bin/lsbom -p f ./Contents/Archive.bom" 
(obviously using the full path to the bom)
(4) shutil.rmtree(os.path.join(IFPkgReceiptLocation, line.rstrip()), 
ignore_errors=True) for every line in the output gathered from (3)

This, of course, basically needs to happen with euid 0.  So, you could:
(a) make it only usable from the shell via sudo
(b) write an AppleScript stub that does the root stuff
(c) use Authorization wrappers
.. amongst other possibilities

-bob



More information about the Pythonmac-SIG mailing list