Dev Install: Add support for --yes option to assume y's to all prompts.
Also some fixes to gmerge workflow to allow easy integration testing.
BUG=chromium-os:12388, chromium-os:37901
TEST=Ran it with devmode-test
Change-Id: If511a65fb81fb2ed3d425005490efc9353283274
Reviewed-on: https://gerrit.chromium.org/gerrit/44763
Commit-Queue: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
diff --git a/gmerge b/gmerge
index 2a321d7..8df098d 100755
--- a/gmerge
+++ b/gmerge
@@ -43,8 +43,13 @@
rc = subprocess.call(['mount', '-o', 'remount,rw', '/'])
if rc == 0:
return
- answer = raw_input(
- 'Could not mount / as writable. Install into /usr/local? (Y/n)')
+ try:
+ answer = raw_input(
+ 'Could not mount / as writable. Install into /usr/local? (Y/n)')
+ except EOFError:
+ # Received if stdin is piped through /dev/null.
+ answer = None
+
if answer and answer[0] not in 'Yy':
sys.exit('Better safe than sorry.')