diff options
author | Greg Becker <becker33@llnl.gov> | 2024-08-14 09:48:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-14 09:48:44 -0700 |
commit | 2b6bdc701312b216f0e1ee9ff850a4a87dd9610e (patch) | |
tree | 134a5867f6b05a49419c5dd9e9ccfe3a27aea3e4 | |
parent | 586a35be4326099734d1c06aaa0360a54020826f (diff) | |
download | spack-2b6bdc701312b216f0e1ee9ff850a4a87dd9610e.tar.gz spack-2b6bdc701312b216f0e1ee9ff850a4a87dd9610e.tar.bz2 spack-2b6bdc701312b216f0e1ee9ff850a4a87dd9610e.tar.xz spack-2b6bdc701312b216f0e1ee9ff850a4a87dd9610e.zip |
OneapiPackage: do not use getpass.getuser (#45727)
* OneapiPackage: do not use getpass.getuser
-rw-r--r-- | lib/spack/spack/build_systems/oneapi.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/spack/spack/build_systems/oneapi.py b/lib/spack/spack/build_systems/oneapi.py index 999b0a189a..a0c8d4fc47 100644 --- a/lib/spack/spack/build_systems/oneapi.py +++ b/lib/spack/spack/build_systems/oneapi.py @@ -3,7 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """Common utilities for managing intel oneapi packages.""" -import getpass import os import platform import shutil @@ -13,6 +12,7 @@ from llnl.util import tty from llnl.util.filesystem import HeaderList, LibraryList, find_libraries, join_path, mkdirp from llnl.util.link_tree import LinkTree +import spack.util.path from spack.build_environment import dso_suffix from spack.directives import conflicts, license, redistribute, variant from spack.package_base import InstallError @@ -99,7 +99,7 @@ class IntelOneApiPackage(Package): # with other install depends on the userid. For root, we # delete the installercache before and after install. For # non root we redefine the HOME environment variable. - if getpass.getuser() == "root": + if spack.util.path.get_user() == "root": shutil.rmtree("/var/intel/installercache", ignore_errors=True) bash = Executable("bash") @@ -122,7 +122,7 @@ class IntelOneApiPackage(Package): self.prefix, ) - if getpass.getuser() == "root": + if spack.util.path.get_user() == "root": shutil.rmtree("/var/intel/installercache", ignore_errors=True) # Some installers have a bug and do not return an error code when failing |