mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +03:00
add keep_when_not_allowed config/option
This commit is contained in:
parent
386fb55b99
commit
1e4e2489aa
3 changed files with 64 additions and 2 deletions
|
|
@ -826,6 +826,15 @@ def force_halt_build(timeout):
|
|||
vm.destroy()
|
||||
|
||||
|
||||
def keep_when_not_allowed():
|
||||
"""Control if APKs signed by keys not in AllowedAPKSigningKeys are removed."""
|
||||
return (
|
||||
(options is not None and options.keep_when_not_allowed)
|
||||
or (config is not None and config.get('keep_when_not_allowed'))
|
||||
or common.default_config['keep_when_not_allowed']
|
||||
)
|
||||
|
||||
|
||||
def parse_commandline():
|
||||
"""Parse the command line.
|
||||
|
||||
|
|
@ -863,6 +872,8 @@ def parse_commandline():
|
|||
help=_("Force build of disabled apps, and carries on regardless of scan problems. Only allowed in test mode."))
|
||||
parser.add_argument("-a", "--all", action="store_true", default=False,
|
||||
help=_("Build all applications available"))
|
||||
parser.add_argument("--keep-when-not-allowed", default=False, action="store_true",
|
||||
help=argparse.SUPPRESS)
|
||||
parser.add_argument("-w", "--wiki", default=False, action="store_true",
|
||||
help=argparse.SUPPRESS)
|
||||
metadata.add_metadata_arguments(parser)
|
||||
|
|
@ -1121,7 +1132,7 @@ def main():
|
|||
logging.warn(_('AllowedAPKSigningKeys missing '
|
||||
'but reference binary supplied'))
|
||||
elif used_key not in expected_keys:
|
||||
if options.test:
|
||||
if options.test or keep_when_not_allowed():
|
||||
logging.warning(_('Keeping failed build "{apkfilename}"')
|
||||
.format(apkfilename=unsigned_apk))
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue