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

Don't use an autoname if it's not found

This commit is contained in:
Ciaran Gultnieks 2014-03-16 22:12:37 +00:00
parent f2a1a83455
commit 6b309aff41
2 changed files with 11 additions and 7 deletions

View File

@ -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)

View File

@ -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'.*<application.*').search
name_search = re.compile(r'.*android:label="([^"]+)".*').search
@ -646,7 +647,7 @@ def fetch_real_name(app_dir, flavour):
stringname = matches.group(1)
logging.debug("fetch_real_name: using string " + stringname)
return retrieve_string(app_dir, stringname).strip()
return ''
return None
# Retrieve the version name
def version_name(original, app_dir, flavour):