spark-instrumented-optimizer/dev/create-release
Kousuke Saruta 2921be7a4e
[SPARK-31462][INFRA] The usage of getopts and case statement is wrong in do-release.sh
### 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>
2020-04-16 12:54:10 -07:00
..
spark-rm [SPARK-31320] Fix release script for 3.0.0 2020-04-01 16:45:28 +09:00
announce.tmpl [SPARK-28951][INFRA] Add release announce template 2019-09-02 14:55:05 -07:00
do-release-docker.sh [SPARK-31462][INFRA] The usage of getopts and case statement is wrong in do-release.sh 2020-04-16 12:54:10 -07:00
do-release.sh [SPARK-31462][INFRA] The usage of getopts and case statement is wrong in do-release.sh 2020-04-16 12:54:10 -07:00
generate-contributors.py [SPARK-25238][PYTHON] lint-python: Fix W605 warnings for pycodestyle 2.4 2018-09-13 11:19:43 +08:00
known_translations [MINOR] update known_translations 2018-11-06 14:52:02 -08:00
release-build.sh [SPARK-30268][INFRA] Fix incorrect pyspark version when releasing preview versions 2019-12-17 10:22:29 +09:00
release-tag.sh [SPARK-30265][INFRA] Do not change R version when releasing preview versions 2019-12-16 04:54:12 -07:00
release-util.sh [SPARK-31320] Fix release script for 3.0.0 2020-04-01 16:45:28 +09:00
releaseutils.py [MINOR][BUILD] ensure call to translate_component has correct number of arguments 2019-01-16 21:00:58 -06:00
translate-contributors.py [SPARK-19002][BUILD][PYTHON] Check pep8 against all Python scripts 2017-01-02 15:23:19 +00:00
vote.tmpl [MINOR][DOCS] Tighten up some key links to the project and download pages to use HTTPS 2019-05-21 10:56:42 -07:00