提交 386ca6ac 编写于 作者: G gimbles

Allow usage of sudo while not accessing root

上级 949b98ca
......@@ -1161,9 +1161,9 @@ class RustBuild(object):
"""Check that vendoring is configured properly"""
vendor_dir = os.path.join(self.rust_root, 'vendor')
if 'SUDO_USER' in os.environ and not self.use_vendored_sources:
if os.environ.get('USER') != os.environ['SUDO_USER']:
if os.getuid() == 0:
self.use_vendored_sources = True
print('info: looks like you are running this command under `sudo`')
print('info: looks like you\'re trying to run this command as root')
print(' and so in order to preserve your $HOME this will now')
print(' use vendored sources by default.')
if not os.path.exists(vendor_dir):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册