chiark / gitweb /
init: --no-prompt to skip sdk_path prompt
authorHans-Christoph Steiner <hans@eds.org>
Wed, 23 Apr 2014 23:22:26 +0000 (19:22 -0400)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 24 Apr 2014 00:10:02 +0000 (20:10 -0400)
For running the tests and in other scripted setups, the user prompt is an
annoying. Using --no-prompt means the script can test for failure.

fdroidserver/init.py
tests/run-tests

index 390a7c7d51e02e8f26c620fee9e069d56e25592e..bf4a05faf245a7c1e2e0e9274a8771be26b02c88 100644 (file)
@@ -105,6 +105,8 @@ def main():
                       help="Alias of the repo signing key in the keystore")
     parser.add_option("--android-home", default=None,
                       help="Path to the Android SDK (sometimes set in ANDROID_HOME)")
+    parser.add_option("--no-prompt", action="store_true", default=False,
+                      help="Do not prompt for Android SDK path, just fail")
     (options, args) = parser.parse_args()
 
     # find root install prefix
@@ -127,7 +129,7 @@ def main():
     elif not common.test_sdk_exists(test_config):
         # if neither --android-home nor the default sdk_path exist, prompt the user
         default_sdk_path = '/opt/android-sdk'
-        while True:
+        while not options.no_prompt:
             s = raw_input('Enter the path to the Android SDK (' + default_sdk_path + ') here:\n> ')
             if re.match('^\s*$', s) != None:
                 test_config['sdk_path'] = default_sdk_path
index b4ff47f6fb32b2a35813e92bd988bb9166d456d9..2d0ad5cdca377bc5934a730805b06c37c5d1bb38 100755 (executable)
@@ -104,7 +104,7 @@ STORED_ANDROID_HOME=$ANDROID_HOME
 unset ANDROID_HOME
 echo "ANDROID_HOME: $ANDROID_HOME"
 cd $REPOROOT
-$fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME
+$fdroid init --keystore $KEYSTORE --android-home $FAKE_ANDROID_HOME --no-prompt
 test -e $KEYSTORE
 copy_apks_into_repo $REPOROOT
 $fdroid update -c