pgj commented on code in PR #5454:
URL: https://github.com/apache/couchdb/pull/5454#discussion_r1982077087
##########
configure:
##########
@@ -473,11 +492,19 @@ check_local_clouseau_dir() {
fetch_file() {
_file_name="$1"
_file_url="$2"
+ _max_attempts=3
+ _attempt=1
- if ! curl -sSL --max-redirs 1 -o "$_file_name" "$_file_url"; then
- printf "ERROR: %s could not be downloaded.\n" "$_file_url" >&2
- exit 1
- fi
+ while [ $_attempt -le $_max_attempts ]; do
+ if curl -sSL --max-redirs 1 -o "$_file_name" "$_file_url"; then
Review Comment:
As far as I am aware `curl` already offers [a built-in retry
mechanism](https://curl.se/docs/manpage.html#--retry).
##########
configure:
##########
@@ -493,34 +520,42 @@ install_local_clouseau() {
_LOGBACK_CLASSIC_JAR=logback-classic-"$LOGBACK_VERSION".jar
_LOGBACK_CLASSIC_URL="$_LOGBACK_DIST_URL"/logback-classic/"$LOGBACK_VERSION"/"$_LOGBACK_CLASSIC_JAR"
+ echo "==> Installing local Clouseau (dist method)..."
check_local_clouseau_dir "$CLOUSEAU_DIR"
+ echo "Creating Clouseau directory at ${CLOUSEAU_DIR}..."
mkdir -p "$CLOUSEAU_DIR"
echo "Fetching Clouseau from $_DIST_URL..."
fetch_file clouseau.zip "$_DIST_URL"
-
+
+ echo "Extracting Clouseau distribution..."
if ! unzip -q -j clouseau.zip -d "$CLOUSEAU_DIR"; then
printf "ERROR: Clouseau distribution package (clouseau.zip)
could not be extracted.\n" >&2
exit 1
fi
+ echo "Removing temporary Clouseau zip file..."
rm clouseau.zip
echo "Fetching Logback $LOGBACK_VERSION from $_LOGBACK_DIST_URL..."
-
fetch_file "$CLOUSEAU_DIR"/"$_LOGBACK_CORE_JAR" "$_LOGBACK_CORE_URL"
+ echo "Fetching Logback $LOGBACK_VERSION classic from
$_LOGBACK_CLASSIC_URL..."
Review Comment:
The messages about fetching files could made part of the `fetch_file` shell
functions instead. Also, this extra `echo` seems redundant since a similar
message is print before calling `fetch_file`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]