stage: avoid using group name in _first_accessible_path()
On machines where $TMP is owned by a gid with no name, this avoids the following error when the default spack stage does not exist: (spackbook):spack$ spack clean ==> Removing all temporary build stages ==> Error: 'getgrgid(): gid not found: 57095' Spack needs to deal with gids directly unless users pass them in.
This commit is contained in:
parent
a41014ed9e
commit
368bf2d69c
@ -3,7 +3,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import grp
|
||||
import os
|
||||
import stat
|
||||
import sys
|
||||
@ -56,8 +55,8 @@ def _first_accessible_path(paths):
|
||||
if not os.path.exists(prefix):
|
||||
break
|
||||
parent = os.path.dirname(prefix)
|
||||
group = grp.getgrgid(os.stat(parent).st_gid)[0]
|
||||
mkdirp(path, group=group, default_perms='parents')
|
||||
gid = os.stat(parent).st_gid
|
||||
mkdirp(path, group=gid, default_perms='parents')
|
||||
|
||||
if can_access(path):
|
||||
return path
|
||||
|
Loading…
Reference in New Issue
Block a user