summarylogtreecommitdiffstats
path: root/spack.bin.py
blob: cc8777253dc1c3ddb9df37f7a0fb67bd8ebcbd08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python
import os
import sys

env = os.environ.copy()
# removing user-specific environement variables
for var in ["USER", "HOME", "LOGNAME"]:
    if var in env:
        env.pop(var)
arg_list = ["/usr/bin/pkexec", "--user", "spack", "/usr/bin/env"]
arg_list += [var + "=" + value for var, value in env.items()]
arg_list.append("/opt/spack/bin/spack")
arg_list += sys.argv[1:]
os.execv("/usr/bin/pkexec", arg_list)