From b02d151bd19c22a53843a0e01010e8319ed7556f Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 6 May 2021 22:32:48 +0200 Subject: [PATCH] btrfs-progs: ci: fix docker-run argument parsing The runner script allows to pass arguments to docker and the final command, using the -- separator. This did not work as expected, the arguments got concatenated to the first member, not all of them passed. The following now works: $ ./docker-run --env CC=clang $ ./docker-run --env CC=clang -- $ ./docker-run --env CC=clang -- /bin/bash Signed-off-by: David Sterba --- ci/images/docker-run | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ci/images/docker-run b/ci/images/docker-run index d9713d28..8be021fa 100755 --- a/ci/images/docker-run +++ b/ci/images/docker-run @@ -1,16 +1,15 @@ #!/bin/bash # Run the container -# $0 [docker arguments] [--] [command and arguments] +# $0 [docker arguments] [-- command and arguments] prefix=kdave image=$(basename `pwd` | tr '[A-Z]' '[a-z]') declare -a ARGS -while :; do +while [ $# -gt 0 ]; do case "$1" in --) shift; break;; - --*) ARGS+="$1"; shift;; - *) break;; + *) ARGS+=("$1"); shift;; esac done