init: fix test for aapt when no aapt has been found

Just give a proper error message rather than this stack trace:

Traceback (most recent call last):
  File "/home/hans/code/fdroid/server/fdroid", line 156, in <module>
    main()
  File "/home/hans/code/fdroid/server/fdroid", line 132, in main
    mod.main()
  File "/export/share/code/fdroid/server/fdroidserver/init.py", line 148, in main
    if os.path.isfile(aapt):
  File "/usr/lib/python3.5/genericpath.py", line 30, in isfile
    st = os.stat(path)
This commit is contained in:
Hans-Christoph Steiner 2017-12-06 13:41:03 +01:00
parent 964ef996a0
commit 1a77c6af38

View file

@ -144,7 +144,7 @@ def main():
if os.path.isfile(os.path.join(d, 'aapt')): if os.path.isfile(os.path.join(d, 'aapt')):
aapt = os.path.join(d, 'aapt') aapt = os.path.join(d, 'aapt')
break break
if os.path.isfile(aapt): if aapt and os.path.isfile(aapt):
dirname = os.path.basename(os.path.dirname(aapt)) dirname = os.path.basename(os.path.dirname(aapt))
if dirname == 'build-tools': if dirname == 'build-tools':
# this is the old layout, before versioned build-tools # this is the old layout, before versioned build-tools