Installations: don't set group permissions when they match what is desired (#38036)

* When installing a package Spack will attempt to set group permissions on
the install prefix even when the configuration does not specify a group.

Co-authored-by: David Gomez <dvdgomez@users.noreply.github.com>
This commit is contained in:
Peter Scheibel
2023-07-05 00:54:04 -07:00
committed by GitHub
parent a90200528f
commit f365386447
2 changed files with 36 additions and 0 deletions

View File

@@ -610,6 +610,8 @@ def chgrp(path, group, follow_symlinks=True):
gid = grp.getgrnam(group).gr_gid
else:
gid = group
if os.stat(path).st_gid == gid:
return
if follow_symlinks:
os.chown(path, -1, gid)
else: