pgj commented on code in PR #4871:
URL: https://github.com/apache/couchdb/pull/4871#discussion_r1407878082


##########
configure:
##########
@@ -381,32 +421,46 @@ install_local_erlfmt() {
 }
 
 install_local_clouseau() {
-    
_DIST_URL=https://github.com/cloudant-labs/clouseau/releases/download/"$CLOUSEAU_VSN"/clouseau-"$CLOUSEAU_VSN"-dist.zip
-    _MAVEN_BASE_URI=https://repo1.maven.org/maven2
-
-    _SLF4J_SIMPLE_VSN=${SLF4J_SIMPLE_VERSION:-1.7.36}
-    _SLF4J_SIMPLE_JAR=slf4j-simple-"$_SLF4J_SIMPLE_VSN".jar
-    
_SLF4J_SIMPLE_URL="$_MAVEN_BASE_URI"/org/slf4j/slf4j-simple/"$_SLF4J_SIMPLE_VSN"/"$_SLF4J_SIMPLE_JAR"
-
-    rm -rf "$CLOUSEAU_DIR"
-    mkdir -p "$CLOUSEAU_DIR"
-
-    if ! curl -sSL --max-redirs 1 -o clouseau.zip "$_DIST_URL"; then
-       printf "ERROR: %s could not be downloaded.\n" "$_DIST_URL" >&2
-       exit 1
-    fi
-
-    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
-
-    rm clouseau.zip
-
-    if ! curl -sSL --max-redirs 1 -o "$CLOUSEAU_DIR"/"$_SLF4J_SIMPLE_JAR" 
"$_SLF4J_SIMPLE_URL"; then
-       printf "ERROR: %s could not be downloaded.\n" "$_SLF4J_SIMPLE_URL" >&2
-       exit 1
-    fi
+    case "$CLOUSEAU_MTH" in
+       [Dd][Ii][Ss][Tt])
+           _DIST_URL=$(printf "$CLOUSEAU_URI" "$CLOUSEAU_VSN" "$CLOUSEAU_VSN")
+           _MAVEN_BASE_URI=https://repo1.maven.org/maven2
+
+           _SLF4J_SIMPLE_VSN=${SLF4J_SIMPLE_VERSION:-1.7.36}
+           _SLF4J_SIMPLE_JAR=slf4j-simple-"$_SLF4J_SIMPLE_VSN".jar
+           
_SLF4J_SIMPLE_URL="$_MAVEN_BASE_URI"/org/slf4j/slf4j-simple/"$_SLF4J_SIMPLE_VSN"/"$_SLF4J_SIMPLE_JAR"
+
+           rm -rf "$CLOUSEAU_DIR"
+           mkdir -p "$CLOUSEAU_DIR"
+
+           echo "Fetching Clouseau from $_DIST_URL..."
+           if ! curl -sSL --max-redirs 1 -o clouseau.zip "$_DIST_URL"; then
+               printf "ERROR: %s could not be downloaded.\n" "$_DIST_URL" >&2
+               exit 1
+           fi
+
+           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
+
+           rm clouseau.zip
+
+           if ! curl -sSL --max-redirs 1 -o 
"$CLOUSEAU_DIR"/"$_SLF4J_SIMPLE_JAR" "$_SLF4J_SIMPLE_URL"; then
+               printf "ERROR: %s could not be downloaded.\n" 
"$_SLF4J_SIMPLE_URL" >&2
+               exit 1
+           fi
+           ;;
+
+       [Gg][Ii][Tt])
+           echo "Cloning Clouseau from $CLOUSEAU_URI ($CLOUSEAU_VSN)..."
+           rm -rf "$CLOUSEAU_DIR"

Review Comment:
   It is the `configure` script, the local Clouseau clone will not be deleted 
for each invocation of `./dev/run`.  But I could still implement the suggested 
safeguard mechanism.



-- 
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]

Reply via email to