From 0b50566f0f14f1727de63a71e8061515da6ac9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 18 Mar 2014 23:37:15 +0100 Subject: [PATCH] Add "Update Check Name" for Tags/RM apps that programmatically change their appid --- fdroidserver/checkupdates.py | 20 ++++++++++++-------- fdroidserver/metadata.py | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index 4609374d..7f7be0e7 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -89,6 +89,7 @@ def check_tags(app, pattern): try: + appid = app['Update Check Name'] if app['Update Check Name'] else app['id'] if app['Repo Type'] == 'srclib': build_dir = os.path.join('build', 'srclib', app['Repo']) repotype = common.getsrclibvcs(app['Repo']) @@ -127,13 +128,15 @@ def check_tags(app, pattern): # Only process tags where the manifest exists... paths = common.manifest_paths(build_dir, flavour) version, vercode, package = common.parse_androidmanifests(paths) - if package and package == app['id'] and version and vercode: - logging.debug("Manifest exists. Found version {0} ({1})".format( - version, vercode)) - if int(vercode) > int(hcode): - htag = tag - hcode = str(int(vercode)) - hver = version + if not package or package != appid or not version or not vercode: + continue + + logging.debug("Manifest exists. Found version {0} ({1})".format( + version, vercode)) + if int(vercode) > int(hcode): + htag = tag + hcode = str(int(vercode)) + hver = version if hver: return (hver, hcode, htag) @@ -159,6 +162,7 @@ def check_repomanifest(app, branch=None): try: + appid = app['Update Check Name'] if 'Update Check Name' in app else app['id'] if app['Repo Type'] == 'srclib': build_dir = os.path.join('build', 'srclib', app['Repo']) repotype = common.getsrclibvcs(app['Repo']) @@ -198,7 +202,7 @@ def check_repomanifest(app, branch=None): version, vercode, package = common.parse_androidmanifests(paths) if not package: return (None, "Couldn't find package ID") - if package != app['id']: + if package != appid: return (None, "Package ID mismatch") if not version: return (None,"Couldn't find latest version name") diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 4158d0cc..3da4b0c9 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -48,6 +48,7 @@ app_defaults = { 'AntiFeatures': None, 'Archive Policy': None, 'Update Check Mode': 'None', + 'Update Check Name': None, 'Update Check Data': None, 'Vercode Operation': None, 'Auto Update Mode': 'None',