[90075] trunk/base/src/macports1.0/macports.tcl

Clemens Lang cal at macports.org
Tue Feb 21 06:01:17 PST 2012


On Wed, Feb 22, 2012 at 12:22:46AM +1100, Joshua Root wrote:
> What if the user running port is not the user who ran it last time?

MacPorts might be getting the wrong Xcode.plist then, but is this really
an issue? To fix this we would have to store where we copied the plist
from.

> Also, the procedure you edited doesn't just handle temporary per-port
> home dirs, it also does /opt/local/var/macports/home.

And that should be working just fine, since the procedure should detect
that the file doesn't exist in the temporary home and copy it.

> What errors were you seeing? What does the macports user have to do
> with running without sudo?

The problem occurs when running port with sudo, which copies the file
from the user's home and chowns it to the macports user. The next time
the user runs port without sudo the procedure will attempt to copy the
file again, but fails to do so, because it can not overwrite the now
macports-owned copy. Since we did this unconditionally this always
failed when invoking port without sudo and caused error messages in
every command and also bash-completion, which calls port internally.

This could probably be also fixed by wrapping the copy operation in
	if {[file writable ${target_dir}/com.apple.dt.Xcode.plist]}.

My fix doesn't solve the general problem but prevents errors from being
displayed after one has run sudo port once until the Xcode.plist is
touched.

-- 
Clemens Lang
GSoC Student



More information about the macports-dev mailing list