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

mbeckerle pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil.git


The following commit(s) were added to refs/heads/main by this push:
     new a13501a90 Improve release candidate script
a13501a90 is described below

commit a13501a90d049114be4495ea114b0ec1c0f4f645
Author: Michael Beckerle <[email protected]>
AuthorDate: Fri Jun 14 16:27:22 2024 -0400

    Improve release candidate script
    
    Defends against empty input strings.
    
    Updates podman instructions since latest podman command syntax
    isn't supported by podman that comes with latest LTS ubuntu version.
    
    DAFFODIL-2914
---
 containers/release-candidate/README.md             |  6 +++++
 .../src/daffodil-release-candidate                 | 30 ++++++++++++++++++----
 2 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/containers/release-candidate/README.md 
b/containers/release-candidate/README.md
index d69c760fb..dad3d0110 100644
--- a/containers/release-candidate/README.md
+++ b/containers/release-candidate/README.md
@@ -25,6 +25,12 @@ To build or update the Daffodil release candidate container 
image:
 
     podman build -t daffodil-release-candidate 
https://github.com/apache/daffodil.git#main:containers/release-candidate
 
+Note: On older versions of podman the URL syntax is not accepted. Verify that 
your local daffodil 
+repo directory is up to date and has no local changes in it, then use this 
alternative command:
+
+    podman build -t daffodil-release-candidate containers/release-candidate
+
+
 To use the container image to build a release run the following:
 
     podman run -it --privileged --group-add keep-groups --rm \
diff --git a/containers/release-candidate/src/daffodil-release-candidate 
b/containers/release-candidate/src/daffodil-release-candidate
index f0ef8d87e..583cd032e 100755
--- a/containers/release-candidate/src/daffodil-release-candidate
+++ b/containers/release-candidate/src/daffodil-release-candidate
@@ -46,6 +46,25 @@ Options:
 USAGE
 }
 
+# Function to get a non-empty string as input
+get_non_empty_input() {
+    local prompt="$1" # prompt the user with this string
+    local input
+
+    while true; do
+        # Prompt the user for input
+        read -p "$prompt" input
+
+        # Check if the input is non-empty
+        if [[ -n $input ]]; then
+            echo "$input"
+            return 0
+        else
+            echo "Empty input. Please try again." >&2
+        fi
+    done
+}
+
 DRY_RUN=false
 
 echo "Which project to release?"
@@ -152,11 +171,12 @@ do
 done
 
 echo
-read -p "Pre Release label (e.g. rc1): " PRE_RELEASE
-read -p "Git Commit Name: " GIT_COMMIT_NAME
-read -p "Git Commit Email: " GIT_COMMIT_EMAIL
-read -p "Apache Username: " APACHE_USERNAME
-read -s -p "Apache Password: " APACHE_PASSWD
+
+PRE_RELEASE=$(get_non_empty_input "Pre Release label (e.g., rc1 to rc99):")
+GIT_COMMIT_NAME=$(get_non_empty_input "Git Commit Name (e.g., 'John Q. 
Smith'):")
+GIT_COMMIT_EMAIL=$(get_non_empty_input "Git Commit Email:")
+APACHE_USERNAME=$(get_non_empty_input "Apache Username:")
+APACHE_PASSWD=$(get_non_empty_input "Apache Password:")
 
 echo
 echo

Reply via email to