From c4f65f2eee0e7e30a7a65a2507b28385635cc470 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 27 Jul 2023 15:20:59 +0100 Subject: [PATCH] cmd/update: output more API information with `--verbose`. Also, hide some spammy/unnecessary newline printing. --- Library/Homebrew/cmd/update.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 76da1beda6..d6b43a7bac 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -781,7 +781,6 @@ EOS export HOMEBREW_UPDATE_AFTER"${TAP_VAR}"="${CURRENT_REVISION}" else merge_or_rebase "${DIR}" "${TAP_VAR}" "${UPSTREAM_BRANCH}" - [[ -n "${HOMEBREW_VERBOSE}" ]] && echo fi done @@ -799,6 +798,11 @@ EOS INITIAL_JSON_BYTESIZE="$(wc -c "${cache_path}")" fi + if [[ -n "${HOMEBREW_VERBOSE}" ]] + then + echo "Checking if we need to fetch ${filename}..." + fi + JSON_URLS=() if [[ -n "${HOMEBREW_API_DOMAIN}" && "${HOMEBREW_API_DOMAIN}" != "${HOMEBREW_API_DEFAULT_DOMAIN}" ]] then @@ -846,6 +850,11 @@ EOS rm -f "${api_cache}/formula_aliases.txt" fi HOMEBREW_UPDATED="1" + + if [[ -n "${HOMEBREW_VERBOSE}" ]] + then + echo "Updated ${filename}." + fi fi else echo "Failed to download ${json_url}!" >>"${update_failed_file}" @@ -855,6 +864,11 @@ EOS # Not a typo, these are the files we used to download that no longer need so should cleanup. rm -f "${HOMEBREW_CACHE}/api/formula.json" "${HOMEBREW_CACHE}/api/cask.json" + else + if [[ -n "${HOMEBREW_VERBOSE}" ]] + then + echo "HOMEBREW_NO_INSTALL_FROM_API set: skipping API JSON downloads." + fi fi if [[ -f "${update_failed_file}" ]]