From a8810b809a01262be96ca7849385c516e4c1d89d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Mon, 4 Nov 2013 17:03:43 +0100 Subject: [PATCH] Don't use proj.prop if not present (fixes tiltmazes) --- fdroidserver/common.py | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 0dd733ee..9ba3dd3e 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1117,6 +1117,24 @@ def version_name(original, app_dir, flavour): return string return original +def ant_subprojects(root_dir): + subprojects = [] + proppath = os.path.join(root_dir, 'project.properties') + if not os.path.isfile(proppath): + return subprojects + with open(proppath) as f: + for line in f.readlines(): + if not line.startswith('android.library.reference.'): + continue + path = line.split('=')[1].strip() + relpath = os.path.join(root_dir, path) + if not os.path.isdir(relpath): + continue + if options.verbose: + print "Found subproject %s..." % path + subprojects.append(path) + return subprojects + # Extract some information from the AndroidManifest.xml at the given path. # Returns (version, vercode, package), any or all of which might be None. # All values returned are strings. @@ -1390,18 +1408,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, sdk_path, parms.append(build['target']) update_dirs = None if updatemode == 'auto': - update_dirs = ['.'] - with open(os.path.join(root_dir, 'project.properties')) as f: - for line in f.readlines(): - if not line.startswith('android.library.reference.'): - continue - path = line.split('=')[1].strip() - relpath = os.path.join(root_dir, path) - if not os.path.isdir(relpath): - continue - if options.verbose: - print "Found subproject %s..." % path - update_dirs.append(path) + update_dirs = ['.'] + ant_subprojects(root_dir) else: update_dirs = [d.strip() for d in updatemode.split(';')] # Force build.xml update if necessary... -- 2.30.2