mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 23:12:46 +03:00
add complete tests for finding apksigner; fix minor detection bug
find_apksigner() was preferring the oldest valid version rather than the newest.
This commit is contained in:
parent
9135dfbeed
commit
b69b95103e
2 changed files with 98 additions and 12 deletions
|
@ -285,7 +285,7 @@ def regsub_file(pattern, repl, path):
|
|||
f.write(text)
|
||||
|
||||
|
||||
def read_config(opts):
|
||||
def read_config(opts=None):
|
||||
"""Read the repository config
|
||||
|
||||
The config is read from config_file, which is in the current
|
||||
|
@ -489,14 +489,15 @@ def find_apksigner(config):
|
|||
continue
|
||||
try:
|
||||
if LooseVersion(f) < LooseVersion(MINIMUM_APKSIGNER_BUILD_TOOLS_VERSION):
|
||||
logging.debug("Local Android SDK only has outdated apksigner versions")
|
||||
return
|
||||
except TypeError:
|
||||
continue
|
||||
if os.path.exists(os.path.join(build_tools_path, f, 'apksigner')):
|
||||
apksigner = os.path.join(build_tools_path, f, 'apksigner')
|
||||
logging.info("Using %s " % apksigner)
|
||||
# memoize result
|
||||
config['apksigner'] = apksigner
|
||||
return
|
||||
|
||||
|
||||
def find_sdk_tools_cmd(cmd):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue