2921be7a4e
### What changes were proposed in this pull request? This PR (SPARK-31462) fixes the usage of getopts and case statement in `do-release.sh` and `do-release-docker.sh`. ### Why are the changes needed? In the current master, do-release.sh contains the following code. ``` while getopts "bn" opt; do case $opt in b) GIT_BRANCH=$OPTARG ;; n) DRY_RUN=1 ;; ?) error "Invalid option: $OPTARG" ;; esac done ``` There are 3 wrong usage in getopts and case statement. 1. To set $OPTARG to an argument passed for the option "b", the parameter for getopts should be "b:". 2. To set $OPTARG to the invalid option name passed, the parameter for getopts starts with ":". 3. It's minor but to match the character "?", it's better to escape like "\\?". ### Does this PR introduce any user-facing change? No. ### How was this patch tested? I checked that $GIT_BRANCH is set when do-release.sh is launched with -b option. I also checked that the error message contains invalid option name when do-release.sh is launched with an invalid option. Closes #28234 from sarutak/fix-do-release. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> |
||
---|---|---|
.. | ||
spark-rm | ||
announce.tmpl | ||
do-release-docker.sh | ||
do-release.sh | ||
generate-contributors.py | ||
known_translations | ||
release-build.sh | ||
release-tag.sh | ||
release-util.sh | ||
releaseutils.py | ||
translate-contributors.py | ||
vote.tmpl |