|
|
d1681e |
From ca93504c637b922cd633f0f2422b18b828982332 Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Anoop C S <anoopcs@redhat.com>
|
|
|
d1681e |
Date: Thu, 19 Oct 2017 13:40:35 +0530
|
|
|
d1681e |
Subject: [PATCH 097/128] extras/hooks: Fix getopt usage
|
|
|
d1681e |
|
|
|
d1681e |
`getopt` does not have an optional argument as '-name'. It should
|
|
|
d1681e |
be either '-n' or '--name'(see man getopt(1)). This wrong usage
|
|
|
d1681e |
resulted in setting the script name as 'ame' instead of $PROGNAME
|
|
|
d1681e |
in most of the hook-scripts.
|
|
|
d1681e |
|
|
|
d1681e |
Additionally the following line from DESCRIPTION given for `getopt`
|
|
|
d1681e |
shell command expects short options for almost every kind of usage
|
|
|
d1681e |
mentioned in SYNOPSIS:
|
|
|
d1681e |
|
|
|
d1681e |
. . .
|
|
|
d1681e |
If no '-o' or '--options' option is found in the first part, the
|
|
|
d1681e |
first parameter of the second part is used as the short options string.
|
|
|
d1681e |
. . .
|
|
|
d1681e |
|
|
|
d1681e |
Refer http://man7.org/linux/man-pages/man1/getopt.1.html for more
|
|
|
d1681e |
clarity on its usage.
|
|
|
d1681e |
|
|
|
d1681e |
> Change-Id: I95baf5fa8c99025e66b2d83656dd838d4f6048ce
|
|
|
d1681e |
> BUG: 1503983
|
|
|
d1681e |
> Upstream: https://review.gluster.org/#/c/18548/
|
|
|
d1681e |
|
|
|
d1681e |
Change-Id: I95baf5fa8c99025e66b2d83656dd838d4f6048ce
|
|
|
d1681e |
BUG: 1444820
|
|
|
d1681e |
Signed-off-by: Anoop C S <anoopcs@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/124641
|
|
|
d1681e |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
d1681e |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh | 2 +-
|
|
|
d1681e |
extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh | 2 +-
|
|
|
d1681e |
extras/hook-scripts/create/post/S10selinux-label-brick.sh | 2 +-
|
|
|
d1681e |
extras/hook-scripts/delete/pre/S10selinux-del-fcontext.sh | 2 +-
|
|
|
d1681e |
extras/hook-scripts/set/post/S30samba-set.sh | 2 +-
|
|
|
d1681e |
extras/hook-scripts/start/post/S29CTDBsetup.sh | 2 +-
|
|
|
d1681e |
extras/hook-scripts/start/post/S30samba-start.sh | 2 +-
|
|
|
d1681e |
extras/hook-scripts/stop/pre/S29CTDB-teardown.sh | 2 +-
|
|
|
d1681e |
extras/hook-scripts/stop/pre/S30samba-stop.sh | 2 +-
|
|
|
d1681e |
9 files changed, 9 insertions(+), 9 deletions(-)
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh b/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh
|
|
|
d1681e |
index ce81816..49ab0a6 100755
|
|
|
d1681e |
--- a/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh
|
|
|
d1681e |
+++ b/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh
|
|
|
d1681e |
@@ -71,7 +71,7 @@ get_and_set_xattr ()
|
|
|
d1681e |
##------------------------------------------
|
|
|
d1681e |
## Parse the arguments
|
|
|
d1681e |
##------------------------------------------
|
|
|
d1681e |
-ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@")
|
|
|
d1681e |
+ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@")
|
|
|
d1681e |
eval set -- "$ARGS"
|
|
|
d1681e |
|
|
|
d1681e |
while true;
|
|
|
d1681e |
diff --git a/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh b/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh
|
|
|
d1681e |
index 38af73f..17ae4b4 100755
|
|
|
d1681e |
--- a/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh
|
|
|
d1681e |
+++ b/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh
|
|
|
d1681e |
@@ -37,7 +37,7 @@ activate ()
|
|
|
d1681e |
##------------------------------------------
|
|
|
d1681e |
## Parse the arguments
|
|
|
d1681e |
##------------------------------------------
|
|
|
d1681e |
-ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@")
|
|
|
d1681e |
+ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@")
|
|
|
d1681e |
eval set -- "$ARGS"
|
|
|
d1681e |
|
|
|
d1681e |
while true;
|
|
|
d1681e |
diff --git a/extras/hook-scripts/create/post/S10selinux-label-brick.sh b/extras/hook-scripts/create/post/S10selinux-label-brick.sh
|
|
|
d1681e |
index 94c624d..6be4072 100755
|
|
|
d1681e |
--- a/extras/hook-scripts/create/post/S10selinux-label-brick.sh
|
|
|
d1681e |
+++ b/extras/hook-scripts/create/post/S10selinux-label-brick.sh
|
|
|
d1681e |
@@ -14,7 +14,7 @@ OPTSPEC="volname:"
|
|
|
d1681e |
VOL=
|
|
|
d1681e |
|
|
|
d1681e |
parse_args () {
|
|
|
d1681e |
- ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@")
|
|
|
d1681e |
+ ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@")
|
|
|
d1681e |
eval set -- "$ARGS"
|
|
|
d1681e |
|
|
|
d1681e |
while true; do
|
|
|
d1681e |
diff --git a/extras/hook-scripts/delete/pre/S10selinux-del-fcontext.sh b/extras/hook-scripts/delete/pre/S10selinux-del-fcontext.sh
|
|
|
d1681e |
index 7851e70..6eba66f 100755
|
|
|
d1681e |
--- a/extras/hook-scripts/delete/pre/S10selinux-del-fcontext.sh
|
|
|
d1681e |
+++ b/extras/hook-scripts/delete/pre/S10selinux-del-fcontext.sh
|
|
|
d1681e |
@@ -15,7 +15,7 @@ OPTSPEC="volname:"
|
|
|
d1681e |
VOL=
|
|
|
d1681e |
|
|
|
d1681e |
function parse_args () {
|
|
|
d1681e |
- ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@")
|
|
|
d1681e |
+ ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@")
|
|
|
d1681e |
eval set -- "$ARGS"
|
|
|
d1681e |
|
|
|
d1681e |
while true; do
|
|
|
d1681e |
diff --git a/extras/hook-scripts/set/post/S30samba-set.sh b/extras/hook-scripts/set/post/S30samba-set.sh
|
|
|
d1681e |
index c21cfb5..b93415b 100755
|
|
|
d1681e |
--- a/extras/hook-scripts/set/post/S30samba-set.sh
|
|
|
d1681e |
+++ b/extras/hook-scripts/set/post/S30samba-set.sh
|
|
|
d1681e |
@@ -28,7 +28,7 @@ USERSMB_SET=""
|
|
|
d1681e |
USERCIFS_SET=""
|
|
|
d1681e |
|
|
|
d1681e |
function parse_args () {
|
|
|
d1681e |
- ARGS=$(getopt -l $OPTSPEC --name $PROGNAME -o "o:" -- "$@")
|
|
|
d1681e |
+ ARGS=$(getopt -o 'o:' -l $OPTSPEC -n $PROGNAME -- "$@")
|
|
|
d1681e |
eval set -- "$ARGS"
|
|
|
d1681e |
|
|
|
d1681e |
while true; do
|
|
|
d1681e |
diff --git a/extras/hook-scripts/start/post/S29CTDBsetup.sh b/extras/hook-scripts/start/post/S29CTDBsetup.sh
|
|
|
d1681e |
index 54a4c0c..69a0d89 100755
|
|
|
d1681e |
--- a/extras/hook-scripts/start/post/S29CTDBsetup.sh
|
|
|
d1681e |
+++ b/extras/hook-scripts/start/post/S29CTDBsetup.sh
|
|
|
d1681e |
@@ -25,7 +25,7 @@ FIRST=
|
|
|
d1681e |
META="all"
|
|
|
d1681e |
|
|
|
d1681e |
function parse_args () {
|
|
|
d1681e |
- ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@")
|
|
|
d1681e |
+ ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@")
|
|
|
d1681e |
eval set -- "$ARGS"
|
|
|
d1681e |
|
|
|
d1681e |
while true; do
|
|
|
d1681e |
diff --git a/extras/hook-scripts/start/post/S30samba-start.sh b/extras/hook-scripts/start/post/S30samba-start.sh
|
|
|
d1681e |
index a448dbd..92ddaf4 100755
|
|
|
d1681e |
--- a/extras/hook-scripts/start/post/S30samba-start.sh
|
|
|
d1681e |
+++ b/extras/hook-scripts/start/post/S30samba-start.sh
|
|
|
d1681e |
@@ -32,7 +32,7 @@ VOLUME_OP=
|
|
|
d1681e |
FIRST=
|
|
|
d1681e |
|
|
|
d1681e |
function parse_args () {
|
|
|
d1681e |
- ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@")
|
|
|
d1681e |
+ ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@")
|
|
|
d1681e |
eval set -- "$ARGS"
|
|
|
d1681e |
|
|
|
d1681e |
while true; do
|
|
|
d1681e |
diff --git a/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh b/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh
|
|
|
d1681e |
index 12f49da..0975a00 100755
|
|
|
d1681e |
--- a/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh
|
|
|
d1681e |
+++ b/extras/hook-scripts/stop/pre/S29CTDB-teardown.sh
|
|
|
d1681e |
@@ -13,7 +13,7 @@ LAST=
|
|
|
d1681e |
META="all"
|
|
|
d1681e |
|
|
|
d1681e |
function parse_args () {
|
|
|
d1681e |
- ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@")
|
|
|
d1681e |
+ ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@")
|
|
|
d1681e |
eval set -- "$ARGS"
|
|
|
d1681e |
|
|
|
d1681e |
while true; do
|
|
|
d1681e |
diff --git a/extras/hook-scripts/stop/pre/S30samba-stop.sh b/extras/hook-scripts/stop/pre/S30samba-stop.sh
|
|
|
d1681e |
index a5c8dd5..5e87845 100755
|
|
|
d1681e |
--- a/extras/hook-scripts/stop/pre/S30samba-stop.sh
|
|
|
d1681e |
+++ b/extras/hook-scripts/stop/pre/S30samba-stop.sh
|
|
|
d1681e |
@@ -23,7 +23,7 @@ PIDDIR=
|
|
|
d1681e |
LAST=
|
|
|
d1681e |
|
|
|
d1681e |
function parse_args () {
|
|
|
d1681e |
- ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@")
|
|
|
d1681e |
+ ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@")
|
|
|
d1681e |
eval set -- "$ARGS"
|
|
|
d1681e |
|
|
|
d1681e |
while true; do
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|