Commit 5e425f07 authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix OPTIND error with shift: -1: shift count

parent 45c3df70
...@@ -69,7 +69,7 @@ done ...@@ -69,7 +69,7 @@ done
# remove args that were options # remove args that were options
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
shift $((OPTIND - 1)) [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi fi
LISTNAMES="$@" LISTNAMES="$@"
......
...@@ -45,7 +45,7 @@ done ...@@ -45,7 +45,7 @@ done
# remove args that were options # remove args that were options
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
shift $((OPTIND - 1)) [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi fi
LISTRPMARGS=$@ LISTRPMARGS=$@
......
...@@ -65,7 +65,7 @@ done ...@@ -65,7 +65,7 @@ done
# FIXME: параметры передаются и дальше (например, -i, -b) # FIXME: параметры передаются и дальше (например, -i, -b)
# remove args that were options # remove args that were options
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
shift $((OPTIND - 1)) [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi fi
# pass other options to RPM: # pass other options to RPM:
......
...@@ -61,7 +61,7 @@ done ...@@ -61,7 +61,7 @@ done
# remove args that were options # remove args that were options
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
shift $((OPTIND - 1)) [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi fi
# pass other options # pass other options
......
...@@ -48,7 +48,7 @@ done ...@@ -48,7 +48,7 @@ done
# remove args that were options # remove args that were options
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
shift $((OPTIND - 1)) [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi fi
# pass other options to RPM (exclude -v): # pass other options to RPM (exclude -v):
......
...@@ -93,7 +93,7 @@ done ...@@ -93,7 +93,7 @@ done
## remove args that were options ## remove args that were options
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
shift $((OPTIND - 1)) [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi fi
LISTRPMARGS=$@ LISTRPMARGS=$@
......
...@@ -56,7 +56,7 @@ done ...@@ -56,7 +56,7 @@ done
## remove args that were options ## remove args that were options
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
shift $((OPTIND - 1)) [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi fi
LISTRPMARGS=$@ LISTRPMARGS=$@
......
...@@ -239,11 +239,7 @@ done ...@@ -239,11 +239,7 @@ done
# FIXME: параметры передаются и дальше (например, -i, -b) # FIXME: параметры передаются и дальше (например, -i, -b)
# remove args that were options # remove args that were options
#if [ $# -gt 0 ]; then [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
# shift $((OPTIND - 1))
#fi
# remove args that were options
shift $((OPTIND - 1))
# pass other options to RPM: # pass other options to RPM:
......
...@@ -48,7 +48,7 @@ while getopts :haf opt; do ...@@ -48,7 +48,7 @@ while getopts :haf opt; do
done done
# remove args that were options # remove args that were options
shift $((OPTIND - 1)) [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
LISTRPMARGS=$@ LISTRPMARGS=$@
......
...@@ -57,7 +57,7 @@ done ...@@ -57,7 +57,7 @@ done
# remove args that were options # remove args that were options
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
shift $((OPTIND - 1)) [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi fi
# pass other options to RPM: # pass other options to RPM:
......
...@@ -52,7 +52,7 @@ done ...@@ -52,7 +52,7 @@ done
# remove args that were options # remove args that were options
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
shift $((OPTIND - 1)) [ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi fi
# pass other options to RPM: # pass other options to RPM:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment