You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Kousuke Saruta (Jira)" <ji...@apache.org> on 2020/04/16 18:45:00 UTC
[jira] [Updated] (SPARK-31462) The usage of getopts and case
statement is wrong in do-release.sh
[ https://issues.apache.org/jira/browse/SPARK-31462?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kousuke Saruta updated SPARK-31462:
-----------------------------------
Description:
In the current master, do-release.sh contains the following code.
{code}
while getopts "bn" opt; do
case $opt in
b) GIT_BRANCH=$OPTARG ;;
n) DRY_RUN=1 ;;
?) error "Invalid option: $OPTARG" ;;
esac
done
{code}
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 "\?".
was:
In the current master, do-release.sh contains the following code.
{code}
while getopts "bn" opt; do
case $opt in
b) GIT_BRANCH=$OPTARG ;;
n) DRY_RUN=1 ;;
?) error "Invalid option: $OPTARG" ;;
esac
done
{code}
There are 3 wrong usage in getopts and case statement.
1. To set an argument to $OPTARG for the option "b", the parameter for getopts should be "b:".
2. To set invalid option name to $OPTARG, the parameter for getopts starts with ":".
3. It's minor but to match the character "?", it's better to escape like "\?".
> The usage of getopts and case statement is wrong in do-release.sh
> -----------------------------------------------------------------
>
> Key: SPARK-31462
> URL: https://issues.apache.org/jira/browse/SPARK-31462
> Project: Spark
> Issue Type: Bug
> Components: Project Infra
> Affects Versions: 3.1.0
> Reporter: Kousuke Saruta
> Assignee: Kousuke Saruta
> Priority: Minor
>
> In the current master, do-release.sh contains the following code.
> {code}
> while getopts "bn" opt; do
> case $opt in
> b) GIT_BRANCH=$OPTARG ;;
> n) DRY_RUN=1 ;;
> ?) error "Invalid option: $OPTARG" ;;
> esac
> done
> {code}
> 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 "\?".
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org