chiark / gitweb /
init: fix test for aapt when no aapt has been found
authorHans-Christoph Steiner <hans@eds.org>
Wed, 6 Dec 2017 12:41:03 +0000 (13:41 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 6 Dec 2017 19:20:17 +0000 (20:20 +0100)
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)

fdroidserver/init.py

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