Non-working non-root install

Bryan Blackburn blb at macports.org
Mon Sep 21 21:24:56 PDT 2009


On Wed, Sep 02, 2009 at 10:21:53AM -0500, Ryan Schmidt said:
> On Aug 31, 2009, at 11:25, Ryan Schmidt wrote:
> 
> >I am attaching a script which reproduces the problem on my system
> >(clean install of Snow Leopard), and the output I get. When you run
> >it, do you see the problem on your system as well? You need to edit
> >the user in the script. Note that it installs MacPorts in /tmp/mp
> >and downloads the MacPorts source to /tmp/macportsbase. You can
> >edit these at the top of the script too if you want.
> 
> Can somebody please test what happens when they run this script on
> their system? It will not affect your current MacPorts install. The
> version of the script attached to this email is updated so that you
> don't need to enter your username manually.

This should be fixed in r58093 (trunk) and r58094 (1.8 branch) now; I wasn't
seeing it initially as it only appears to happen on 10.6 but was running
10.5 at the time.

The basic problem is that Tcl doesn't like to set a permission of 0444 when
also using '-creator {}' when you aren't root.  The way the code was
initially working was that all attributes that 'file attributes' returns
were being set on the newly-installed file, as can be seen when you try it:

$ tclsh
% file attributes /mach_kernel
-group wheel -owner root -permissions 00644 -readonly 0 -creator {} -type {} -hidden 1 -rsrclength 0

For man pages, the permission mode is 0444, combined with not being root and
using that '-creator {}', it fails:

$ touch /tmp/foo
$ tclsh
% file attributes /tmp/foo -permissions 0444 -creator {}
could not set attributes of "/tmp/foo": permission denied

However, 0644 is fine, or using 0444 without creator is also fine.  The code
now just specifically sets the permissions, owner, and group, ignoring the
other bits.

Bryan



More information about the macports-users mailing list