1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 00:40:11 +01:00

Fix a few remaining gradle flavour crashes

This commit is contained in:
Daniel Martí 2014-09-15 11:52:12 +02:00
parent 1757017b8a
commit 8d1c4c1d60

View File

@ -109,14 +109,12 @@ def check_tags(app, pattern):
vcs.gotorevision(None) vcs.gotorevision(None)
flavour = None flavours = []
if len(app['builds']) > 0: if len(app['builds']) > 0:
if app['builds'][-1]['subdir']: if app['builds'][-1]['subdir']:
build_dir = os.path.join(build_dir, app['builds'][-1]['subdir']) build_dir = os.path.join(build_dir, app['builds'][-1]['subdir'])
if app['builds'][-1]['gradle']: if app['builds'][-1]['gradle']:
flavour = app['builds'][-1]['gradle'] flavours = app['builds'][-1]['gradle']
if flavour == 'yes':
flavour = None
hpak = None hpak = None
htag = None htag = None
@ -136,7 +134,7 @@ def check_tags(app, pattern):
vcs.gotorevision(tag) vcs.gotorevision(tag)
# Only process tags where the manifest exists... # Only process tags where the manifest exists...
paths = common.manifest_paths(build_dir, flavour) paths = common.manifest_paths(build_dir, flavours)
version, vercode, package = \ version, vercode, package = \
common.parse_androidmanifests(paths, app['Update Check Ignore']) common.parse_androidmanifests(paths, app['Update Check Ignore'])
if not package or package != appid or not version or not vercode: if not package or package != appid or not version or not vercode:
@ -196,20 +194,17 @@ def check_repomanifest(app, branch=None):
elif repotype == 'bzr': elif repotype == 'bzr':
vcs.gotorevision(None) vcs.gotorevision(None)
flavour = None flavours = []
if len(app['builds']) > 0: if len(app['builds']) > 0:
if app['builds'][-1]['subdir']: if app['builds'][-1]['subdir']:
build_dir = os.path.join(build_dir, app['builds'][-1]['subdir']) build_dir = os.path.join(build_dir, app['builds'][-1]['subdir'])
if app['builds'][-1]['gradle']: if app['builds'][-1]['gradle']:
flavour = app['builds'][-1]['gradle'] flavours = app['builds'][-1]['gradle']
if flavour == 'yes':
flavour = None
if not os.path.isdir(build_dir): if not os.path.isdir(build_dir):
return (None, "Subdir '" + app['builds'][-1]['subdir'] + "'is not a valid directory") return (None, "Subdir '" + app['builds'][-1]['subdir'] + "'is not a valid directory")
paths = common.manifest_paths(build_dir, flavour) paths = common.manifest_paths(build_dir, flavours)
version, vercode, package = \ version, vercode, package = \
common.parse_androidmanifests(paths, app['Update Check Ignore']) common.parse_androidmanifests(paths, app['Update Check Ignore'])
@ -319,15 +314,13 @@ def check_changed_subdir(app):
if not os.path.isdir(build_dir): if not os.path.isdir(build_dir):
return None return None
flavour = None flavours = []
if len(app['builds']) > 0 and app['builds'][-1]['gradle']: if len(app['builds']) > 0 and app['builds'][-1]['gradle']:
flavour = app['builds'][-1]['gradle'] flavours = app['builds'][-1]['gradle']
if flavour == 'yes':
flavour = None
for d in dirs_with_manifest(build_dir): for d in dirs_with_manifest(build_dir):
logging.debug("Trying possible dir %s." % d) logging.debug("Trying possible dir %s." % d)
m_paths = common.manifest_paths(d, flavour) m_paths = common.manifest_paths(d, flavours)
package = common.parse_androidmanifests(m_paths, app['Update Check Ignore'])[2] package = common.parse_androidmanifests(m_paths, app['Update Check Ignore'])[2]
if package and package == appid: if package and package == appid:
logging.debug("Manifest exists in possible dir %s." % d) logging.debug("Manifest exists in possible dir %s." % d)
@ -352,7 +345,7 @@ def fetch_autoname(app, tag):
except VCSException: except VCSException:
return None return None
flavours = None flavours = []
if len(app['builds']) > 0: if len(app['builds']) > 0:
if app['builds'][-1]['subdir']: if app['builds'][-1]['subdir']:
app_dir = os.path.join(app_dir, app['builds'][-1]['subdir']) app_dir = os.path.join(app_dir, app['builds'][-1]['subdir'])