Skip to content

Commit 47c41d4

Browse files
refactor(scalability): use variable for compile directory (#459)
* refactor(compile): use variable for working directory * feat: protect against unset directory * fix(ui) suppress ICU message
1 parent 1f6a22c commit 47c41d4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

nodebuilder

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,14 @@ esac
409409
if [ "${current_bitcoin_version}" = "${target_bitcoin_version_padded}" ]; then
410410
printf '%s\n' "found."
411411
elif [ "$(uname -s)" = 'Linux' ] && [ "$(get_os_release_type)" = "alpine" ]; then
412+
compile_directory="${temp_directory}/compile_bitcoin"
412413
stderr_compile_log_file="${temp_directory}/stderr_install.log"
413414
printf '%s\n %s' "not found." "Installing build dependencies... "
414-
apk --quiet add alpine-sdk libffi-dev autoconf automake db-dev boost boost-dev libtool libevent-dev 2> "${stderr_compile_log_file}"
415-
grep -v "ICU with non-English" -A2 -B1 "${stderr_compile_log_file}" >&2 || true
415+
apk --quiet add alpine-sdk libffi-dev autoconf automake db-dev boost boost-dev libtool libevent-dev |
416+
grep -v "ICU with non-English locales" -A2 -B1 || true
416417
printf '%s\n %s' "ok." "Downloading Bitcoin source code... "
417-
git clone --branch "v${target_bitcoin_version}" --single-branch --depth 1 --quiet -c advice.detachedHead=false https://github.com/bitcoin/bitcoin.git "${temp_directory}"/compile_bitcoin
418-
cd "${temp_directory}"/compile_bitcoin/
418+
git clone --branch "v${target_bitcoin_version}" --single-branch --depth 1 --quiet -c advice.detachedHead=false https://github.com/bitcoin/bitcoin.git "${compile_directory}"
419+
cd "${compile_directory}"/
419420
printf '%s\n %s' "ok." "Analyzing hardware confgiruation... "
420421
./autogen.sh > /dev/null 2> "${stderr_compile_log_file}"
421422
grep -v "build-aux" "${stderr_compile_log_file}" >&2 || true
@@ -433,8 +434,9 @@ elif [ "$(uname -s)" = 'Linux' ] && [ "$(get_os_release_type)" = "alpine" ]; the
433434
grep -v "Ran 3 tests in " -A1 -B2 "${stderr_compile_log_file}" >&2 || true
434435
printf '%s\n %s' "ok." "Installing Bitcoin... "
435436
make install > /dev/null
437+
cd "${temp_directory}"/
436438
rm "${stderr_compile_log_file}"
437-
rm -rf "${temp_directory}"/compile_bitcoin/
439+
rm -rf "${compile_directory:?}"/
438440
current_bitcoin_version="${target_bitcoin_version}"
439441
else
440442
printf '%s\n' "not found."

0 commit comments

Comments
 (0)