[MacPorts] #49501: Spaces and Backslashes in Group Names
MacPorts
noreply at macports.org
Thu Oct 29 06:09:46 PDT 2015
#49501: Spaces and Backslashes in Group Names
-----------------------+--------------------------------
Reporter: citibob@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Low | Milestone:
Component: base | Version: 2.3.4
Keywords: | Port:
-----------------------+--------------------------------
I'm installing MacPorts non-root. Unfortunately, my group name has a
space and backslash in it. This cannot be changed at my organization:
{{{
> whoami
johndoe
> id -g -n `whoami`
NDC\Domain Users
}}}
MacPorts doesn't work when you try to ./configure and then make install.
I currently have a workaround; the general idea is to use a numeric group
ID instead of group name. First, I configure as follows (Python code
here):
{{{
user_info = pwd.getpwuid(os.getuid())
self.pw_name = user_info[0] # pw_name
self.pw_gid = user_info[3] # pw_gid
cmd = ['./configure', '--enable-readline',
'--prefix={}'.format(self.dest_dir),
'--with-install-user={}'.format(self.pw_name),
'--with-install-group={}'.format(self.pw_gid)]
self.run_cmd(cmd, cwd=self.src_dir)
}}}
Then I apply the following patches on the generated files before running
make:
{{{
file_replace(os.path.join(self.src_dir, 'doc/base.mtree'), 'gname', 'gid')
file_replace(os.path.join(self.src_dir, 'doc/prefix.mtree'), 'gname',
'gid')
file_replace(os.path.join(self.src_dir, 'doc/macosx.mtree'),
'uname=root gname=wheel', 'uname={} gid={}'.format(self.pw_name,
self.pw_gid))
file_replace(os.path.join(self.src_dir, 'doc/macosx.mtree'),
'uname=root gname=admin', 'uname={} gid={}'.format(self.pw_name,
self.pw_gid))
}}}
Would it be possible to update the core MacPorts so this patching is not
required? Also... a similar fix would probably be needed for those poor
souls with backslashes or spaces in their username.
--
Ticket URL: <https://trac.macports.org/ticket/49501>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list