Fix temporary directory handling for dependency handling script in updater. (#12562)
Austin S. Hemmelgarn committed
Mar 31, 2022 at 07:18 UTC
6a2d3ca16887428641c83abdc411a954dde9803b
1 file changed
+5
-5
packaging/installer/netdata-updater.sh
+5
-5
@@ -132,9 +132,9 @@ install_build_dependencies() {
132
fi
133
134
info "Fetching dependency handling script..."
135
- download "${PACKAGES_SCRIPT}" "${TMPDIR}/install-required-packages.sh" || true
135
+ download "${PACKAGES_SCRIPT}" "./install-required-packages.sh" || true
136
137
- if [ ! -s "${TMPDIR}/install-required-packages.sh" ]; then
137
+ if [ ! -s "./install-required-packages.sh" ]; then
138
error "Downloaded dependency installation script is empty."
139
else
140
info "Running dependency handling script..."
@@ -142,7 +142,7 @@ install_build_dependencies() {
142
opts="--dont-wait --non-interactive"
143
144
# shellcheck disable=SC2086
145
- if ! "${bash}" "${TMPDIR}/install-required-packages.sh" ${opts} netdata >&3 2>&3; then
145
+ if ! "${bash}" "./install-required-packages.sh" ${opts} netdata >&3 2>&3; then
146
error "Installing build dependencies failed. The update should still work, but you might be missing some features."
147
fi
148
fi
@@ -511,12 +511,12 @@ set_tarball_urls() {
511
update_build() {
512
[ -z "${logfile}" ] && info "Running on a terminal - (this script also supports running headless from crontab)"
513
514
- install_build_dependencies
515
-
514
RUN_INSTALLER=0
515
ndtmpdir=$(create_tmp_directory)
516
cd "$ndtmpdir" || exit 1
517
518
+ install_build_dependencies
519
+
520
if update_available; then
521
download "${NETDATA_TARBALL_CHECKSUM_URL}" "${ndtmpdir}/sha256sum.txt" >&3 2>&3
522
download "${NETDATA_TARBALL_URL}" "${ndtmpdir}/netdata-latest.tar.gz"