mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
Run shell scripts with -e (Closes: #1035)
Make sudo, init prebuild, build and Prepare fields lists and only concatenate them with '; ' before execution. This allows arbitrary commands inside the fileds (even && and ';') as we don't need to split the commands again for rewritemeta.
This commit is contained in:
parent
49d8ba3b9b
commit
557fe87d44
10 changed files with 477 additions and 254 deletions
|
@ -40,7 +40,17 @@ import fdroidserver.metadata # noqa
|
|||
|
||||
def _build_yaml_representer(dumper, data):
|
||||
"""Create a YAML representation of a Build instance."""
|
||||
return dumper.represent_dict(data)
|
||||
# internal representation of keys were switched
|
||||
# to lists instead of strings concatenated by &&
|
||||
# https://gitlab.com/fdroid/fdroidserver/merge_requests/1185
|
||||
output = {}
|
||||
for k, v in data.items():
|
||||
if k in ("build", "init", "prebuild", "sudo"):
|
||||
output[k] = " && ".join(v)
|
||||
else:
|
||||
output[k] = v
|
||||
|
||||
return dumper.represent_dict(output)
|
||||
|
||||
|
||||
parser = ArgumentParser()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue