build: --test now keeps unsigned APKs in tmp/ that fail to reproduce

Before, whenever an unsigned APK failed to reproduce, it was just deleted.
That makes debugging hard.  This makes it keep the unsigned APK, which is
written in tmp/ when using --test.

@jspricke this is related to !864
This commit is contained in:
Hans-Christoph Steiner 2021-04-14 09:59:13 +02:00
parent 6097caef91
commit 0b0bc803b7
2 changed files with 108 additions and 2 deletions

View file

@ -1146,8 +1146,12 @@ def main():
compare_result = \
common.verify_apks(of, unsigned_apk, tmpdir)
if compare_result:
logging.debug('removing %s', unsigned_apk)
os.remove(unsigned_apk)
if options.test:
logging.warning(_('Keeping failed build "{apkfilename}"')
.format(apkfilename=unsigned_apk))
else:
logging.debug('removing %s', unsigned_apk)
os.remove(unsigned_apk)
logging.debug('removing %s', of)
os.remove(of)
compare_result = compare_result.split('\n')