mirror of
https://github.com/nicolargo/glances.git
synced 2024-11-29 15:32:25 +03:00
parent
f4cca40717
commit
8b63d555e3
9
setup.py
9
setup.py
@ -6,6 +6,8 @@ import sys
|
||||
|
||||
from setuptools import setup
|
||||
|
||||
is_chroot = os.stat('/').st_ino != 2
|
||||
|
||||
|
||||
def get_data_files():
|
||||
data_files = [
|
||||
@ -15,15 +17,16 @@ def get_data_files():
|
||||
('share/man/man1', ['man/glances.1'])
|
||||
]
|
||||
|
||||
if os.name == 'posix' and os.getuid() == 0: # Unix-like + root privileges
|
||||
if hasattr(sys, 'real_prefix'): # virtualenv
|
||||
conf_path = os.path.join(sys.prefix, 'etc', 'glances')
|
||||
elif os.name == 'posix' and (os.getuid() == 0 or is_chroot):
|
||||
# Unix-like + root privileges/chroot environment
|
||||
if 'bsd' in sys.platform:
|
||||
conf_path = os.path.join(sys.prefix, 'etc', 'glances')
|
||||
elif 'linux' in sys.platform:
|
||||
conf_path = os.path.join('/etc', 'glances')
|
||||
elif 'darwin' in sys.platform:
|
||||
conf_path = os.path.join('/usr/local', 'etc', 'glances')
|
||||
elif hasattr(sys, 'real_prefix'): # virtualenv
|
||||
conf_path = os.path.join(sys.prefix, 'etc', 'glances')
|
||||
elif 'win32' in sys.platform: # windows
|
||||
conf_path = os.path.join(os.environ.get('APPDATA'), 'glances')
|
||||
else: # Unix-like + per-user install
|
||||
|
Loading…
Reference in New Issue
Block a user