mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-14 02:50:12 +01:00
Don't use an autoname if it's not found
This commit is contained in:
parent
f2a1a83455
commit
6b309aff41
@ -416,11 +416,14 @@ def main():
|
|||||||
logging.debug("...fetch auto name from " + app_dir +
|
logging.debug("...fetch auto name from " + app_dir +
|
||||||
((" (flavour:" + flavour) if flavour else ""))
|
((" (flavour:" + flavour) if flavour else ""))
|
||||||
new_name = common.fetch_real_name(app_dir, flavour)
|
new_name = common.fetch_real_name(app_dir, flavour)
|
||||||
logging.debug("...got autoname '" + new_name + "'")
|
if new_name:
|
||||||
if new_name != app['Auto Name']:
|
logging.debug("...got autoname '" + new_name + "'")
|
||||||
app['Auto Name'] = new_name
|
if new_name != app['Auto Name']:
|
||||||
if not commitmsg:
|
app['Auto Name'] = new_name
|
||||||
commitmsg = "Set autoname of {0}".format(common.getappname(app))
|
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/'):
|
if app['Current Version'].startswith('@string/'):
|
||||||
cv = common.version_name(app['Current Version'], app_dir, flavour)
|
cv = common.version_name(app['Current Version'], app_dir, flavour)
|
||||||
|
@ -611,6 +611,7 @@ def retrieve_string(app_dir, string, xmlfiles=None):
|
|||||||
matches = string_search(line)
|
matches = string_search(line)
|
||||||
if matches:
|
if matches:
|
||||||
return retrieve_string(app_dir, matches.group(1), xmlfiles)
|
return retrieve_string(app_dir, matches.group(1), xmlfiles)
|
||||||
|
return None
|
||||||
|
|
||||||
return string.replace("\\'","'")
|
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)]
|
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):
|
def fetch_real_name(app_dir, flavour):
|
||||||
app_search = re.compile(r'.*<application.*').search
|
app_search = re.compile(r'.*<application.*').search
|
||||||
name_search = re.compile(r'.*android:label="([^"]+)".*').search
|
name_search = re.compile(r'.*android:label="([^"]+)".*').search
|
||||||
@ -646,7 +647,7 @@ def fetch_real_name(app_dir, flavour):
|
|||||||
stringname = matches.group(1)
|
stringname = matches.group(1)
|
||||||
logging.debug("fetch_real_name: using string " + stringname)
|
logging.debug("fetch_real_name: using string " + stringname)
|
||||||
return retrieve_string(app_dir, stringname).strip()
|
return retrieve_string(app_dir, stringname).strip()
|
||||||
return ''
|
return None
|
||||||
|
|
||||||
# Retrieve the version name
|
# Retrieve the version name
|
||||||
def version_name(original, app_dir, flavour):
|
def version_name(original, app_dir, flavour):
|
||||||
|
Loading…
Reference in New Issue
Block a user