mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
init: --no-prompt to skip sdk_path prompt
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.
This commit is contained in:
parent
66df02d5f8
commit
ef7c9d89d2
@ -105,6 +105,8 @@ def main():
|
|||||||
help="Alias of the repo signing key in the keystore")
|
help="Alias of the repo signing key in the keystore")
|
||||||
parser.add_option("--android-home", default=None,
|
parser.add_option("--android-home", default=None,
|
||||||
help="Path to the Android SDK (sometimes set in ANDROID_HOME)")
|
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()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
# find root install prefix
|
# find root install prefix
|
||||||
@ -127,7 +129,7 @@ def main():
|
|||||||
elif not common.test_sdk_exists(test_config):
|
elif not common.test_sdk_exists(test_config):
|
||||||
# if neither --android-home nor the default sdk_path exist, prompt the user
|
# if neither --android-home nor the default sdk_path exist, prompt the user
|
||||||
default_sdk_path = '/opt/android-sdk'
|
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> ')
|
s = raw_input('Enter the path to the Android SDK (' + default_sdk_path + ') here:\n> ')
|
||||||
if re.match('^\s*$', s) != None:
|
if re.match('^\s*$', s) != None:
|
||||||
test_config['sdk_path'] = default_sdk_path
|
test_config['sdk_path'] = default_sdk_path
|
||||||
|
@ -104,7 +104,7 @@ STORED_ANDROID_HOME=$ANDROID_HOME
|
|||||||
unset ANDROID_HOME
|
unset ANDROID_HOME
|
||||||
echo "ANDROID_HOME: $ANDROID_HOME"
|
echo "ANDROID_HOME: $ANDROID_HOME"
|
||||||
cd $REPOROOT
|
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
|
test -e $KEYSTORE
|
||||||
copy_apks_into_repo $REPOROOT
|
copy_apks_into_repo $REPOROOT
|
||||||
$fdroid update -c
|
$fdroid update -c
|
||||||
|
Loading…
Reference in New Issue
Block a user