From: Daniel Martí Date: Fri, 6 Dec 2013 11:37:53 +0000 (+0100) Subject: Take "$VALUE" settings from environment variables X-Git-Tag: 0.1~126 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9ecf6fcf7407ccf0183de092baa6f0afd4cd8229;p=fdroidserver.git Take "$VALUE" settings from environment variables Set sdk_path and ndk_path defaults to $ANDROID_HOME and $ANDROID_NDK --- diff --git a/config.sample.py b/config.sample.py index cb026580..85c17d50 100644 --- a/config.sample.py +++ b/config.sample.py @@ -1,21 +1,22 @@ - # Copy this file to config.py, then amend the settings below according to # your system configuration. -# Path to the Android SDK ($ANDROID_HOME) -sdk_path = "/path/to/android-sdk-linux_86" +# Path to the Android SDK, $ANDROID_HOME already set on most systems +#sdk_path = "/path/to/android-sdk" +sdk_path = "$ANDROID_HOME" -# Path to the Android NDK ($ANDROID_NDK) +# Path to the Android NDK, $ANDROID_NDK already set on most systems # Legacy toolchains are only needed by some apps -ndk_path = "/path/to/android-ndk-r9" +#ndk_path = "/path/to/android-ndk" +ndk_path = "$ANDROID_NDK" # Build tools version to be used build_tools = "18.1.1" -# Command for running maven 3 (could be mvn, mvn3, or a full path) +# Command for running maven 3 (command or full path) mvn3 = "mvn3" -# Command for running Gradle +# Command for running Gradle (command or full path) gradle = "gradle" # Android gradle plugin version @@ -105,8 +106,6 @@ stats_to_carbon = False carbon_host = '0.0.0.0' carbon_port = 2003 - #Set this to true to always use a build server. This saves specifying the #--server option on dedicated secure build server hosts. build_server_always = False - diff --git a/fdroidserver/common.py b/fdroidserver/common.py index da39e2ce..629d6d6f 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -67,6 +67,11 @@ def read_config(opts, config_file='config.py'): if options.verbose: print "Reading %s..." % config_file execfile(config_file, config) + for k, v in config.items(): + if type(v) != str: + continue + if v[0] == '$': + config[k] = os.environ[v[1:]] return config def getapkname(app, build):