How to make "sudo port install" run a post-activate script with only user permission?

Bradley Giesbrecht pixilla at macports.org
Thu Oct 4 08:13:08 PDT 2012


On Oct 4, 2012, at 7:19 AM, Kevin Reid wrote:

> On Oct 4, 2012, at 7:13, Jeremy Lavergne wrote:
> 
>>> Is it possible to tell the port command (normally called with sudo) that it should run a post-activate script with the permissions of the installing user (i.e. not user macports or root)?
>> 
>> Perhaps we could add that. 
>> 
>> We could use $SUDO_USER or logname, but I'm not sure how fragile an assumption those will be. I imagine it'd be messy if they're wrong and end up installing a bunch of files and directories with the wrong owner.
> 
> I would like to offer the opinion that having this dependence at all is bad user interface design -- it's a piece of context the experienced user doesn't expect to matter when they write 'sudo ...', and not only that:
> 
> And I run as a non-admin user, so I have to 'su' to another user before 'sudo' installing a port. Who is the proper 'installing user', and can you tell?
> 
> What if you want to 'install for' multiple users?
> 
> Better to have user-dependent operations done independently of MacPorts and independent of system-wide directories, IMO.

I agree.

It would be appropriate to install LaunchAgents and scripts to help current and future users of the system configure the software and env for proper function.


Regards,
Bradley Giesbrecht (pixilla)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2763 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20121004/51e9e05e/attachment-0001.p7s>


More information about the macports-dev mailing list