From a0efdf34417b5564a7474e8c2175b9e643640b8f Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 2 Feb 2017 22:27:15 +0100 Subject: [PATCH 1/3] Don't check for sudo environment if vendored sources are already configured --- src/bootstrap/bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 85e8dbce1a9..958ffd11008 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -438,7 +438,7 @@ def main(): rb.use_vendored_sources = '\nvendor = true' in rb.config_toml or \ 'CFG_ENABLE_VENDOR' in rb.config_mk - if 'SUDO_USER' in os.environ: + if 'SUDO_USER' in os.environ and not rb.use_vendored_sources: if os.environ['USER'] != os.environ['SUDO_USER']: rb.use_vendored_sources = True print('info: looks like you are running this command under `sudo`') From 8e793eb3c64e289d4fa5850bf28d10fe5b3e062a Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 2 Feb 2017 22:28:00 +0100 Subject: [PATCH 2/3] Guard against USER not existing in the environment --- src/bootstrap/bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 958ffd11008..3869b286102 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -439,7 +439,7 @@ def main(): 'CFG_ENABLE_VENDOR' in rb.config_mk if 'SUDO_USER' in os.environ and not rb.use_vendored_sources: - if os.environ['USER'] != os.environ['SUDO_USER']: + if os.environ.get('USER') != os.environ['SUDO_USER']: rb.use_vendored_sources = True print('info: looks like you are running this command under `sudo`') print(' and so in order to preserve your $HOME this will now') From 51e5cb525db60435ea32c5a77c17ac75fe580f64 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 2 Feb 2017 22:28:26 +0100 Subject: [PATCH 3/3] Fix typo in bootstrap.py info message --- src/bootstrap/bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 3869b286102..bc834110242 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -445,7 +445,7 @@ def main(): print(' and so in order to preserve your $HOME this will now') print(' use vendored sources by default. Note that if this') print(' does not work you should run a normal build first') - print(' before running a command like `sudo make intall`') + print(' before running a command like `sudo make install`') if rb.use_vendored_sources: if not os.path.exists('.cargo'):