From 6b309aff41b1ede22589dad9d5dbb90985ad0aa5 Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Sun, 16 Mar 2014 22:12:37 +0000 Subject: [PATCH] Don't use an autoname if it's not found --- fdroidserver/checkupdates.py | 13 ++++++++----- fdroidserver/common.py | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index b56aa201..4609374d 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -416,11 +416,14 @@ def main(): logging.debug("...fetch auto name from " + app_dir + ((" (flavour:" + flavour) if flavour else "")) new_name = common.fetch_real_name(app_dir, flavour) - logging.debug("...got autoname '" + new_name + "'") - if new_name != app['Auto Name']: - app['Auto Name'] = new_name - if not commitmsg: - commitmsg = "Set autoname of {0}".format(common.getappname(app)) + if new_name: + logging.debug("...got autoname '" + new_name + "'") + if new_name != app['Auto Name']: + app['Auto Name'] = new_name + if not commitmsg: + commitmsg = "Set autoname of {0}".format(common.getappname(app)) + else: + logging.debug("...couldn't get autoname") if app['Current Version'].startswith('@string/'): cv = common.version_name(app['Current Version'], app_dir, flavour) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 388e3970..98d2752f 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -611,6 +611,7 @@ def retrieve_string(app_dir, string, xmlfiles=None): matches = string_search(line) if matches: return retrieve_string(app_dir, matches.group(1), xmlfiles) + return None return string.replace("\\'","'") @@ -627,7 +628,7 @@ def manifest_paths(app_dir, flavour): return [path for path in possible_manifests if os.path.isfile(path)] -# Retrieve the package name +# Retrieve the package name. Returns the name, or None if not found. def fetch_real_name(app_dir, flavour): app_search = re.compile(r'.*