Why was the macports user implemented

Ryan Schmidt ryandesign at macports.org
Wed Aug 31 12:59:16 PDT 2011

On Aug 31, 2011, at 14:40, Jeremy Lavergne wrote:

> On Wed, August 31, 2011 3:26 pm, Rodolfo Aramayo wrote:
>> Regardless we have to 'sudo'  to install MacPorts and its ports, right?
> One can also build ports without sudo, and they'll be built and installed
> in your $HOME; one can compile MacPorts itself to live entirely in your
> $HOME.

...or wherever you want it to be, specified using the --prefix flag to the MacPorts ./configure script.

>> You said " The typical way of implementing this is creating a user and
>> group, so
>>> permissions on files can be set to `macports:macports`."
>> can be set or must be set??
> I'd assume "can be". You can change this user by compiling MacPorts
> itself: check out MacPort's own ./configure options. There might be a
> macports.conf setting for this, but I cannot authoritatively answer that
> one :-) Ryan knows perhaps?

Well it's the "macportsuser" setting in macports.conf, but I don't know if this is one of those settings you can just change whenever you want (most of them you can), or one of those settings (like prefix) that are meant to be thought of as read-only, and set only by passing the appropriate option (i.e. --with-macports-user) to the MacPorts configure script. I assume it's the former, since the macportsuser is only used for the duration of building a port, and files that remain on the hard drive after installation are not owned by this user. I believe you could for example set macportsuser to "root" to get back the behavior of MacPorts 1.9 but have not tried this.

>> Does MacPorts checks if the ports are owned by macports:macports?
> I will again assume here: no. I think it will simply test that it has
> permission to do what it is trying to do, and give you an error if it
> cannot complete it. Ryan, do you know better? :-)

I don't believe either the portfiles collection nor the files a port installs are intended to be owned by the macportsuser, so I don't believe MacPorts base includes any code to check for such a thing.

More information about the macports-users mailing list