This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new b8e6dc24bad7 [SPARK-52276][BUILD] Make ANSWER not to be overwritten in 
release scripts
b8e6dc24bad7 is described below

commit b8e6dc24bad71a2f251d652eb81ffedc00bc1d40
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Fri May 23 12:24:47 2025 +0900

    [SPARK-52276][BUILD] Make ANSWER not to be overwritten in release scripts
    
    ### What changes were proposed in this pull request?
    
    This PR is rather a followup of 
https://github.com/apache/spark/commit/d7d8b243c7d7c787b335ec83e9de4112a6b3294c 
. This PR makes ANSWER not to be overwritten in release scripts.
    
    ### Why are the changes needed?
    
    ANSWER should not be overwritten.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, dev-only.
    
    ### How was this patch tested?
    
    Manually ran the script.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #50995 from HyukjinKwon/SPARK-52225-followup3.
    
    Authored-by: Hyukjin Kwon <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 dev/create-release/do-release-docker.sh | 18 +++++++++++-------
 dev/create-release/release-util.sh      | 19 +++++++++++--------
 2 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/dev/create-release/do-release-docker.sh 
b/dev/create-release/do-release-docker.sh
index 433843da9492..eaa8073fbca6 100755
--- a/dev/create-release/do-release-docker.sh
+++ b/dev/create-release/do-release-docker.sh
@@ -72,9 +72,11 @@ fi
 
 if [ -d "$WORKDIR/output" ]; then
   if [ -z "$ANSWER" ]; then
-    read -p "Output directory already exists. Overwrite and continue? [y/n] " 
ANSWER
-  fi
-  if [ "$ANSWER" != "y" ]; then
+    read -p "Output directory already exists. Overwrite and continue? [y/n] " 
userinput
+    if [ "$userinput" != "y" ]; then
+      error "Exiting."
+    fi
+  elif [ "$ANSWER" != "y" ]; then
     error "Exiting."
   fi
 fi
@@ -82,9 +84,11 @@ fi
 if [ ! -z "$RELEASE_STEP" ] && [ "$RELEASE_STEP" = "finalize" ]; then
   echo "THIS STEP IS IRREVERSIBLE! Make sure the vote has passed and you pick 
the right RC to finalize."
   if [ -z "$ANSWER" ]; then
-    read -p "You must be a PMC member to run this step. Continue? [y/n] " 
ANSWER
-  fi
-  if [ "$ANSWER" != "y" ]; then
+    read -p "You must be a PMC member to run this step. Continue? [y/n] " 
userinput
+    if [ "$userinput" != "y" ]; then
+      error "Exiting."
+    fi
+  elif [ "$ANSWER" != "y" ]; then
     error "Exiting."
   fi
 
@@ -163,7 +167,7 @@ if [ -n "$JAVA" ]; then
 fi
 
 echo "Building $RELEASE_TAG; output will be at $WORKDIR/output"
-docker $([ -z "$GITHUB_ACTIONS" ] && echo "-ti") run \
+docker run $([ -z "$GITHUB_ACTIONS" ] && echo "-ti") \
   --env-file "$ENVFILE" \
   --volume "$WORKDIR:/opt/spark-rm" \
   $JAVA_VOL \
diff --git a/dev/create-release/release-util.sh 
b/dev/create-release/release-util.sh
index 3c2e3bd2296d..01e38856b01f 100755
--- a/dev/create-release/release-util.sh
+++ b/dev/create-release/release-util.sh
@@ -150,9 +150,11 @@ function get_release_info {
   SKIP_TAG="${SKIP_TAG:-0}"
   if check_for_tag "$RELEASE_TAG" && [[ $SKIP_TAG = 0 ]]; then
     if [ -z "$ANSWER" ]; then
-      read -p "$RELEASE_TAG already exists. Continue anyway [y/n]? " ANSWER
-    fi
-    if [ "$ANSWER" != "y" ]; then
+      read -p "$RELEASE_TAG already exists. Continue anyway [y/n]? " userinput
+      if [ "$userinput" != "y" ]; then
+        error "Exiting."
+      fi
+    elif [ "$ANSWER" != "y" ]; then
       error "Exiting."
     fi
     SKIP_TAG=1
@@ -201,11 +203,12 @@ E-MAIL:     $GIT_EMAIL
 EOF
 
   if [ -z "$ANSWER" ]; then
-    read -p "Is this info correct [y/n]? " ANSWER
-  fi
-  if [ "$ANSWER" != "y" ]; then
-    echo "Exiting."
-    exit 1
+    read -p "Is this info correct [y/n]? " userinput
+    if [ "$userinput" != "y" ]; then
+      error "Exiting."
+    fi
+  elif [ "$ANSWER" != "y" ]; then
+    error "Exiting."
   fi
 
   if ! is_dry_run; then


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to