return (None, msg)
-def app_matches_packagename(app, package):
- if not package:
- return False
- appid = app['Update Check Name'] or app['id']
- if appid == "Ignore":
- return True
- return appid == package
-
-
# Check for a new version by looking at the tags in the source repo.
# Whether this can be used reliably or not depends on
# the development procedures used by the project's developers. Use it with
else:
root_dir = os.path.join(build_dir, subdir)
paths = common.manifest_paths(root_dir, flavours)
- version, vercode, package = \
- common.parse_androidmanifests(paths, app['Update Check Ignore'])
+ version, vercode, package = common.parse_androidmanifests(paths, app)
if vercode:
logging.debug("Manifest exists in subdir '{0}'. Found version {1} ({2})"
.format(subdir, version, vercode))
else:
root_dir = os.path.join(build_dir, subdir)
paths = common.manifest_paths(root_dir, flavours)
- version, vercode, package = \
- common.parse_androidmanifests(paths, app['Update Check Ignore'])
+ version, vercode, package = common.parse_androidmanifests(paths, app)
if vercode:
logging.debug("Manifest exists in subdir '{0}'. Found version {1} ({2})"
.format(subdir, version, vercode))
for d in dirs_with_manifest(build_dir):
m_paths = common.manifest_paths(d, flavours)
- package = common.parse_androidmanifests(m_paths, app['Update Check Ignore'])[2]
- if app_matches_packagename(app, package):
+ package = common.parse_androidmanifests(m_paths, app)[2]
+ if package is not None:
subdir = os.path.relpath(d, build_dir)
logging.debug("Adding possible subdir %s" % subdir)
yield subdir
psearch_g = re.compile(r'.*(packageName|applicationId) *=* *["\']([^"]+)["\'].*').search
+def app_matches_packagename(app, package):
+ if not package:
+ return False
+ appid = app['Update Check Name'] or app['id']
+ if appid == "Ignore":
+ return True
+ return appid == package
+
+
# Extract some information from the AndroidManifest.xml at the given path.
# Returns (version, vercode, package), any or all of which might be None.
# All values returned are strings.
-def parse_androidmanifests(paths, ignoreversions=None):
+def parse_androidmanifests(paths, app):
+ ignoreversions = app['Update Check Ignore']
ignoresearch = re.compile(ignoreversions).search if ignoreversions else None
if not paths:
if not package:
matches = psearch_g(line)
if matches:
- package = matches.group(2)
+ s = matches.group(2)
+ if app_matches_packagename(app, s):
+ package = s
if not version:
matches = vnsearch_g(line)
if matches: