diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-09-26 11:55:23 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-09-26 11:55:23 -0700 |
commit | a7fdd2c63cb8b673a1a59d9d57ba41687a61ba0f (patch) | |
tree | 153d2d2205e9167df5c4edf44173cca3d1b38284 | |
parent | 926b9f56a28d8a902dbff4c954b1050a9d237d75 (diff) |
remove misleading top line in settings when copying it to ~/.emscripten
-rwxr-xr-x | tests/runner.py | 8 | ||||
-rw-r--r-- | tools/settings_template_readonly.py | 4 | ||||
-rw-r--r-- | tools/shared.py | 4 |
3 files changed, 12 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py index a3779668..c0283c05 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -8832,7 +8832,13 @@ elif 'sanity' in str(sys.argv): self.assertContained('make sure LLVM_ROOT and NODE_JS are correct', output) self.assertContained('This command will now exit. When you are done editing those paths, re-run it.', output) assert output.split()[-1].endswith('===='), 'We should have stopped: ' + output - assert (open(CONFIG_FILE).read() == open(path_from_root('tools', 'settings_template_readonly.py')).read()), 'Settings should be copied from tools/settings_template_readonly.py' + config_file = open(CONFIG_FILE).read() + template_file = open(path_from_root('tools', 'settings_template_readonly.py')).read() + self.assertNotContained('~/.emscripten', config_file) + self.assertContained('~/.emscripten', template_file) + for content in ['EMSCRIPTEN_ROOT', 'LLVM_ROOT', 'NODE_JS', 'TEMP_DIR', 'COMPILER_ENGINE', 'JS_ENGINES']: + self.assertContained(content, config_file) + self.assertContained(config_file, template_file) # Second run, with bad EM_CONFIG for settings in ['blah', 'LLVM_ROOT="blarg"; JS_ENGINES=[]; COMPILER_ENGINE=NODE_JS=SPIDERMONKEY_ENGINE=[]']: diff --git a/tools/settings_template_readonly.py b/tools/settings_template_readonly.py index 45a30569..8d03237e 100644 --- a/tools/settings_template_readonly.py +++ b/tools/settings_template_readonly.py @@ -1,5 +1,5 @@ -# This file will be copied to ~/.emscripten if that file doesn't exist. Or, this is that copy. -# IMPORTANT: Edit the *copy* with the right paths! +# This file will be copied to ~/.emscripten if that file doesn't exist. + # Note: If you put paths relative to the home directory, do not forget os.path.expanduser import os diff --git a/tools/shared.py b/tools/shared.py index 2fc894d0..e46b10b9 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -20,7 +20,9 @@ if '\n' in EM_CONFIG: else: CONFIG_FILE = os.path.expanduser(EM_CONFIG) if not os.path.exists(CONFIG_FILE): - shutil.copy(path_from_root('tools', 'settings_template_readonly.py'), CONFIG_FILE) + config_file = open(path_from_root('tools', 'settings_template_readonly.py')).read().split('\n') + config_file = config_file[1:] # remove "this file will be copied..." + open(CONFIG_FILE, 'w').write('\n'.join(config_file)) print >> sys.stderr, ''' ============================================================================== Welcome to Emscripten! |