scons: Allow clean non-interactive builds
On a clean build, the git tool will wait for input() before installing git hooks. Allow bypassing this via a command-line flag, making it possible to perform a clean build non-interactively. Bug: 199780674 Test: build_gem5 --install-hooks Change-Id: I48be2c1a7c2335a2f4f6359adf582ca8b0ae5939 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50410 Reviewed-by: Gabe Black <gabe.black@gmail.com> Maintainer: Gabe Black <gabe.black@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -42,6 +42,7 @@ import os
|
||||
import sys
|
||||
|
||||
import gem5_scons.util
|
||||
import SCons.Script
|
||||
|
||||
git_style_message = """
|
||||
You're missing the gem5 style or commit message hook. These hooks help
|
||||
@@ -99,11 +100,14 @@ def install_style_hooks(env):
|
||||
return
|
||||
|
||||
print(git_style_message, end=' ')
|
||||
try:
|
||||
input()
|
||||
except:
|
||||
print("Input exception, exiting scons.\n")
|
||||
sys.exit(1)
|
||||
if SCons.Script.GetOption('install-hooks'):
|
||||
print("Installing revision control hooks automatically.")
|
||||
else:
|
||||
try:
|
||||
input()
|
||||
except:
|
||||
print("Input exception, exiting scons.\n")
|
||||
sys.exit(1)
|
||||
|
||||
git_style_script = env.Dir("#util").File("git-pre-commit.py")
|
||||
git_msg_script = env.Dir("#ext").File("git-commit-msg")
|
||||
|
||||
Reference in New Issue
Block a user