chiark
/
gitweb
/
~ianmdlvl
/
fdroidserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
37aa3a7
)
config['sdk_path'] will never be None, behave properly if ANDROID_HOME is unset
author
Daniel Martí
<mvdan@mvdan.cc>
Mon, 15 Sep 2014 10:49:36 +0000
(12:49 +0200)
committer
Daniel Martí
<mvdan@mvdan.cc>
Mon, 15 Sep 2014 10:49:36 +0000
(12:49 +0200)
fdroidserver/common.py
patch
|
blob
|
history
diff --git
a/fdroidserver/common.py
b/fdroidserver/common.py
index 52a3bf72be951ad906285523b5fae6d0033ade14..ba8080a70778ed7cf6668079f95b12363113c914 100644
(file)
--- a/
fdroidserver/common.py
+++ b/
fdroidserver/common.py
@@
-195,32
+195,31
@@
def read_config(opts, config_file='config.py'):
return config
return config
-def test_sdk_exists(c):
- if c['sdk_path'] is None:
- # c['sdk_path'] is set to the value of ANDROID_HOME by default
+def test_sdk_exists(config):
+ if config['sdk_path'] == default_config['sdk_path']:
logging.error('No Android SDK found!')
logging.error('You can use ANDROID_HOME to set the path to your SDK, i.e.:')
logging.error('\texport ANDROID_HOME=/opt/android-sdk')
return False
logging.error('No Android SDK found!')
logging.error('You can use ANDROID_HOME to set the path to your SDK, i.e.:')
logging.error('\texport ANDROID_HOME=/opt/android-sdk')
return False
- if not os.path.exists(c['sdk_path']):
- logging.critical('Android SDK path "' + c['sdk_path'] + '" does not exist!')
+ if not os.path.exists(c
onfig
['sdk_path']):
+ logging.critical('Android SDK path "' + c
onfig
['sdk_path'] + '" does not exist!')
return False
return False
- if not os.path.isdir(c['sdk_path']):
- logging.critical('Android SDK path "' + c['sdk_path'] + '" is not a directory!')
+ if not os.path.isdir(c
onfig
['sdk_path']):
+ logging.critical('Android SDK path "' + c
onfig
['sdk_path'] + '" is not a directory!')
return False
for d in ['build-tools', 'platform-tools', 'tools']:
return False
for d in ['build-tools', 'platform-tools', 'tools']:
- if not os.path.isdir(os.path.join(c['sdk_path'], d)):
+ if not os.path.isdir(os.path.join(c
onfig
['sdk_path'], d)):
logging.critical('Android SDK path "%s" does not contain "%s/"!' % (
logging.critical('Android SDK path "%s" does not contain "%s/"!' % (
- c['sdk_path'], d))
+ c
onfig
['sdk_path'], d))
return False
return True
return False
return True
-def test_build_tools_exists(c):
- if not test_sdk_exists(c):
+def test_build_tools_exists(c
onfig
):
+ if not test_sdk_exists(c
onfig
):
return False
return False
- build_tools = os.path.join(c['sdk_path'], 'build-tools')
- versioned_build_tools = os.path.join(build_tools, c['build_tools'])
+ build_tools = os.path.join(c
onfig
['sdk_path'], 'build-tools')
+ versioned_build_tools = os.path.join(build_tools, c
onfig
['build_tools'])
if not os.path.isdir(versioned_build_tools):
logging.critical('Android Build Tools path "'
+ versioned_build_tools + '" does not exist!')
if not os.path.isdir(versioned_build_tools):
logging.critical('Android Build Tools path "'
+ versioned_build_tools + '" does not exist!')