A deep clone of a MacPorts setup (especially the uid/gid of created users/groups)?

Gerben Wierda gerben.wierda at rna.nl
Tue Sep 10 20:20:07 UTC 2024


> On 10 Sep 2024, at 21:30, Ryan Carsten Schmidt <ryandesign at macports.org> wrote:
> 
> On Sep 10, 2024, at 06:08, Gerben Wierda wrote:
>> 
>> Is there a way I can clone the MacPorts created users/groups first keeping them at the same uid/gid and then do a reinstall, so MacPorts finds already created users and leaves them alone?
> 
> If MacPorts needs a user account that doesn't exist it creates it with the next available UID. If matching UIDs between systems are important to you you can precreate users on the second system with UIDs matching those on the first system. MacPorts doesn't contain any code to help you do that so you'll be writing it yourself. MacPorts contains no code that keeps track of what users have been created either so you'll need to figure that out too.

I know that MacPorts doesn't do that. I was just asking the people here who generally know more of these systems than average how they would go about doing this.

Basically, my plan is to compare the local database (/var/db/dslocal/nodes/Default) to see which items have been created by MacPorts installs, copy these over so that a next MacPorts install would find the users already created

But dscl cannot really do import/output so copying the plists is probably the easiest option. I don't know if such a file based approach works (nothing changed elsewhere on the system?) 

G


More information about the macports-users mailing list