diff --git a/.yupdate.post b/.yupdate.post index 439917ae4a..2d91b28549 100755 --- a/.yupdate.post +++ b/.yupdate.post @@ -10,6 +10,12 @@ # next yupdate run # +set -e + +if [ "$DEBUG" == "1" ]; then + set -x +fi + SERVICE_NAME="agama" # restart the installer service if needed diff --git a/.yupdate.pre b/.yupdate.pre index eb2503a280..7caabc21c8 100755 --- a/.yupdate.pre +++ b/.yupdate.pre @@ -16,6 +16,12 @@ # run the yupdate script several times # +set -e + +if [ "$DEBUG" == "1" ]; then + set -x +fi + if [ "$YUPDATE_SKIP_FRONTEND" == "1" ]; then exit 0 fi @@ -47,8 +53,13 @@ function add_repos() { } function install_packages() { + # stop the service, it might hold the libzypp lock preventing from installing the packages + systemctl stop "$SERVICE_NAME" + add_repos zypper --non-interactive install --no-recommends "${PACKAGES[@]}" + + systemctl start "$SERVICE_NAME" } # restore the NPM cache if it is present