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
# remove args that were options
if [ $# -gt 0 ]; then
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi
LISTNAMES="$@"
......
......@@ -45,7 +45,7 @@ done
# remove args that were options
if [ $# -gt 0 ]; then
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi
LISTRPMARGS=$@
......
......@@ -65,7 +65,7 @@ done
# FIXME: параметры передаются и дальше (например, -i, -b)
# remove args that were options
if [ $# -gt 0 ]; then
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi
# pass other options to RPM:
......
......@@ -61,7 +61,7 @@ done
# remove args that were options
if [ $# -gt 0 ]; then
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi
# pass other options
......
......@@ -48,7 +48,7 @@ done
# remove args that were options
if [ $# -gt 0 ]; then
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi
# pass other options to RPM (exclude -v):
......
......@@ -93,7 +93,7 @@ done
## remove args that were options
if [ $# -gt 0 ]; then
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi
LISTRPMARGS=$@
......
......@@ -56,7 +56,7 @@ done
## remove args that were options
if [ $# -gt 0 ]; then
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi
LISTRPMARGS=$@
......
......@@ -239,11 +239,7 @@ done
# FIXME: параметры передаются и дальше (например, -i, -b)
# remove args that were options
#if [ $# -gt 0 ]; then
# shift $((OPTIND - 1))
#fi
# remove args that were options
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
# pass other options to RPM:
......
......@@ -48,7 +48,7 @@ while getopts :haf opt; do
done
# remove args that were options
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
LISTRPMARGS=$@
......
......@@ -57,7 +57,7 @@ done
# remove args that were options
if [ $# -gt 0 ]; then
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi
# pass other options to RPM:
......
......@@ -52,7 +52,7 @@ done
# remove args that were options
if [ $# -gt 0 ]; then
shift $((OPTIND - 1))
[ "$OPTIND" -gt 0 ] && shift $(($OPTIND - 1))
fi
# 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