verify_apk_signature: work when options is not set

Then test_signatures.py can run on the PUBLISH CI job.
This commit is contained in:
Hans-Christoph Steiner 2025-03-12 17:03:13 +01:00
parent 8d17b67642
commit 5150c721f4
2 changed files with 3 additions and 2 deletions

View file

@ -739,6 +739,7 @@ PUBLISH:
tests/test_gpgsign.py tests/test_gpgsign.py
tests/test_metadata.py tests/test_metadata.py
tests/test_publish.py tests/test_publish.py
tests/test_signatures.py
tests/test_signindex.py tests/test_signindex.py
- cd tests - cd tests

View file

@ -3894,11 +3894,11 @@ def verify_apk_signature(apk, min_sdk_version=None):
args = [config['apksigner'], 'verify'] args = [config['apksigner'], 'verify']
if min_sdk_version: if min_sdk_version:
args += ['--min-sdk-version=' + min_sdk_version] args += ['--min-sdk-version=' + min_sdk_version]
if options.verbose: if options and options.verbose:
args += ['--verbose'] args += ['--verbose']
try: try:
output = subprocess.check_output(args + [apk]) output = subprocess.check_output(args + [apk])
if options.verbose: if options and options.verbose:
logging.debug(apk + ': ' + output.decode('utf-8')) logging.debug(apk + ': ' + output.decode('utf-8'))
return True return True
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e: