mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
appsv2/regenconf: prevent set -u to be enabled during regen-conf triggered from inside appsv2 scripts
This commit is contained in:
parent
d5cc3dc13d
commit
a7350a7eae
3 changed files with 4 additions and 1 deletions
|
@ -65,7 +65,7 @@ ynh_abort_if_errors() {
|
|||
}
|
||||
|
||||
# When running an app script with packaging format >= 2, auto-enable ynh_abort_if_errors except for remove script
|
||||
if dpkg --compare-versions ${YNH_APP_PACKAGING_FORMAT:-0} ge 2 && [[ ${YNH_APP_ACTION} != "remove" ]]
|
||||
if [[ "${YNH_CONTEXT:-}" != "regenconf" ]] && dpkg --compare-versions ${YNH_APP_PACKAGING_FORMAT:-0} ge 2 && [[ ${YNH_APP_ACTION} != "remove" ]]
|
||||
then
|
||||
ynh_abort_if_errors
|
||||
fi
|
||||
|
|
|
@ -452,6 +452,8 @@ def _hook_exec_bash(path, args, chdir, env, user, return_format, loggers):
|
|||
logger.debug("Executing command '%s'" % command)
|
||||
|
||||
_env = os.environ.copy()
|
||||
if "YNH_CONTEXT" in _env:
|
||||
del _env["YNH_CONTEXT"]
|
||||
_env.update(env)
|
||||
|
||||
# Remove the 'HOME' var which is causing some inconsistencies between
|
||||
|
|
|
@ -139,6 +139,7 @@ def regen_conf(
|
|||
env["YNH_MAIN_DOMAINS"] = " ".join(
|
||||
domain_list(exclude_subdomains=True)["domains"]
|
||||
)
|
||||
env["YNH_CONTEXT"] = "regenconf"
|
||||
|
||||
pre_result = hook_callback("conf_regen", names, pre_callback=_pre_call, env=env)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue