chiark / gitweb /
improved error messages related to missing/non-functional SDK paths
authorHans-Christoph Steiner <hans@eds.org>
Thu, 3 Apr 2014 20:42:04 +0000 (16:42 -0400)
committerHans-Christoph Steiner <hans@eds.org>
Mon, 7 Apr 2014 20:00:17 +0000 (16:00 -0400)
fdroidserver/common.py

index 205beccfdc3b8d371c40fd1047c12d9231ec0815..4aafc5224d451a9de613ad6a5808ef1f9c900097 100644 (file)
@@ -66,8 +66,7 @@ def read_config(opts, config_file='config.py'):
         'stats_to_carbon': False,
         'repo_maxage': 0,
         'build_server_always': False,
-        'keystore': os.path.join(os.getenv('HOME'),
-                                 '.local', 'share', 'fdroidserver', 'keystore.jks'),
+        'keystore': '$HOME/.local/share/fdroidserver/keystore.jks',
         'char_limits': {
             'Summary' : 50,
             'Description' : 1500
@@ -86,10 +85,13 @@ def read_config(opts, config_file='config.py'):
         config[k] = os.path.expandvars(v)
 
     if not config['sdk_path']:
-        logging.critical("$ANDROID_HOME is not set!")
+        logging.critical("Neither $ANDROID_HOME nor sdk_path is set, no Android SDK found!")
+        sys.exit(3)
+    if not os.path.exists(config['sdk_path']):
+        logging.critical('Android SDK path "' + config['sdk_path'] + '" does not exist!')
         sys.exit(3)
     if not os.path.isdir(config['sdk_path']):
-        logging.critical("$ANDROID_HOME points to a non-existing directory!")
+        logging.critical('Android SDK path "' + config['sdk_path'] + '" is not a directory!')
         sys.exit(3)
 
     if any(k in config for k in ["keystore", "keystorepass", "keypass"]):