diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:05 +0000 |
commit | 97e01009d69b8fbebfebf68f51e3d126d0ed43fc (patch) | |
tree | 02e8b836c3a9d89806f3e67d4a5fe9f52dbb0061 /packaging/installer/netdata-updater.sh | |
parent | Releasing debian version 1.36.1-1. (diff) | |
download | netdata-97e01009d69b8fbebfebf68f51e3d126d0ed43fc.tar.xz netdata-97e01009d69b8fbebfebf68f51e3d126d0ed43fc.zip |
Merging upstream version 1.37.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/installer/netdata-updater.sh')
-rwxr-xr-x | packaging/installer/netdata-updater.sh | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh index 15b7deda8..d018d67d2 100755 --- a/packaging/installer/netdata-updater.sh +++ b/packaging/installer/netdata-updater.sh @@ -85,9 +85,17 @@ exit_reason() { EXIT_REASON="${1}" EXIT_CODE="${2}" if [ -n "${NETDATA_PROPAGATE_WARNINGS}" ]; then - export EXIT_REASON - export EXIT_CODE - export NETDATA_WARNINGS + if [ -n "${NETDATA_SCRIPT_STATUS_PATH}" ]; then + { + echo "EXIT_REASON=\"${EXIT_REASON}\"" + echo "EXIT_CODE=\"${EXIT_CODE}\"" + echo "NETDATA_WARNINGS=\"${NETDATA_WARNINGS}\"" + } >> "${NETDATA_SCRIPT_STATUS_PATH}" + else + export EXIT_REASON + export EXIT_CODE + export NETDATA_WARNINGS + fi fi fi } @@ -602,15 +610,20 @@ update_build() { export NETDATA_SAVE_WARNINGS=1 export NETDATA_PROPAGATE_WARNINGS=1 export NETDATA_WARNINGS="${NETDATA_WARNINGS}" + export NETDATA_SCRIPT_STATUS_PATH="${NETDATA_SCRIPT_STATUS_PATH}" # shellcheck disable=SC2086 if ! ${env} ./netdata-installer.sh ${REINSTALL_OPTIONS} --dont-wait ${do_not_start} >&3 2>&3; then + if [ -r "${NETDATA_SCRIPT_STATUS_PATH}" ]; then + # shellcheck disable=SC1090 + . "${NETDATA_SCRIPT_STATUS_PATH}" + rm -f "${NETDATA_SCRIPT_STATUS_PATH}" + fi if [ -n "${EXIT_REASON}" ]; then fatal "Failed to rebuild existing netdata install: ${EXIT_REASON}" "U${EXIT_CODE}" else fatal "Failed to rebuild existing netdata reinstall." UI0000 fi fi - eval "${env} ./netdata-installer.sh ${REINSTALL_OPTIONS} --dont-wait ${do_not_start}" >&3 2>&3 || fatal "FAILED TO COMPILE/INSTALL NETDATA" U0009 # We no longer store checksum info here. but leave this so that we clean up all environment files upon next update. sed -i '/NETDATA_TARBALL/d' "${ENVIRONMENT_FILE}" @@ -650,7 +663,7 @@ update_static() { # Do not pass any options other than the accept, for now # shellcheck disable=SC2086 - if sh "${ndtmpdir}/netdata-${sysarch}-latest.gz.run" --accept -- ${REINSTALL_OPTIONS}; then + if sh "${ndtmpdir}/netdata-${sysarch}-latest.gz.run" --accept -- ${REINSTALL_OPTIONS} >&3 2>&3; then rm -r "${ndtmpdir}" else info "NOTE: did not remove: ${ndtmpdir}" @@ -691,7 +704,7 @@ update_binpkg() { opensuse-leap) DISTRO_COMPAT_NAME="opensuse" ;; - almalinux|rocky|rhel) + cloudlinux|almalinux|rocky|rhel) DISTRO_COMPAT_NAME="centos" ;; *) |