Ticket #21082 (closed defect: fixed)
MacPorts 1.8.0 deletes ${prefix} if it is a symlink
| Reported by: | ryandesign@… | Owned by: | macports-tickets@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | MacPorts 1.8.1 |
| Component: | base | Version: | 1.8.0 |
| Keywords: | Cc: | merlyn@…, and.damore@…, alakazam@…, dh@…, blb@…, mike@…, ketanpadegaonkar+macports@…, jmr@… | |
| Port: |
Description
If you install MacPorts 1.8.0 in a certain prefix, say /a, and then move it some place else, say /b, and make a symlink at /a pointing to /b, then "port install" works ok, but "port deactivate" and "port uninstall" will both remove the symlink at /a, thus breaking the installation. This did not happen with 1.7.1. This bug was reported on the mailing list by Randal L. Schwartz.
Attached is a script I wrote to test for the problem. It will download MacPorts base trunk to /tmp/mpbase, download the portindex and zlib portfile to /tmp/mpdports, and compile MacPorts and install it in the prefix /tmp/mpone. It will move /tmp/mpone to /tmp/mptwo and create a symlink at /tmp/mpone pointing to /tmp/mptwo. It will install zlib, downloading the zlib distfile in /tmp/mpdistfiles, and then deactivate zlib. It will state whether /tmp/mpone still exists, and then delete /tmp/mpone and /tmp/mptwo.
As an argument to the script, you can specify the revision of trunk you want to test. Testing on Leopard I get:
$ sudo ./symlinkbug.sh 55000 [snip] Bug present in base rev 55000: /tmp/mpone is gone $ sudo ./symlinkbug.sh 50000 [snip] Bug absent in base rev 50000: /tmp/mpone exists $
Now we just need to do some bisecting and figure out which revision between 50000 and 55000 caused the problem. I suggest first looking at the revision that merged in the GSoC '08 privileges code, and the revisions that changed from calling system executables to calling Tcl functions.


