Message ID | 20170726083909.30029-1-rkrcmar@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Jul 26, 2017 at 10:39:09AM +0200, Radim Krčmář wrote: > Spaces in an argument made the quoted result occupy multiple array > fields after splitting. The test broke if the third argument was > shifted because of that. (arm/gicv2*) > > Populate the array explicitly, instead of relying on splitting. > > Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> > --- > scripts/mkstandalone.sh | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh > index a15941f75375..c1ecb7f99cdc 100755 > --- a/scripts/mkstandalone.sh > +++ b/scripts/mkstandalone.sh > @@ -7,13 +7,6 @@ fi > source config.mak > source scripts/common.bash > > -escape () > -{ > - for arg in "${@}"; do > - printf "%q " "$arg"; # XXX: trailing whitespace > - done > -} > - > temp_file () > { > local var="$1" > @@ -36,7 +29,10 @@ config_export () > > generate_test () > { > - local args=( $(escape "${@}") ) > + local args=() > + for arg in "${@}"; do > + args+=("$(printf "%q" "$arg")") > + done > > echo "#!/usr/bin/env bash" > echo "export STANDALONE=yes" > -- > 2.13.3 > Reviewed-by: Andrew Jones <drjones@redhat.com>
On 26/07/2017 10:49, Andrew Jones wrote: > On Wed, Jul 26, 2017 at 10:39:09AM +0200, Radim Krčmář wrote: >> Spaces in an argument made the quoted result occupy multiple array >> fields after splitting. The test broke if the third argument was >> shifted because of that. (arm/gicv2*) >> >> Populate the array explicitly, instead of relying on splitting. >> >> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> Applied, thanks. Paolo >> --- >> scripts/mkstandalone.sh | 12 ++++-------- >> 1 file changed, 4 insertions(+), 8 deletions(-) >> >> diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh >> index a15941f75375..c1ecb7f99cdc 100755 >> --- a/scripts/mkstandalone.sh >> +++ b/scripts/mkstandalone.sh >> @@ -7,13 +7,6 @@ fi >> source config.mak >> source scripts/common.bash >> >> -escape () >> -{ >> - for arg in "${@}"; do >> - printf "%q " "$arg"; # XXX: trailing whitespace >> - done >> -} >> - >> temp_file () >> { >> local var="$1" >> @@ -36,7 +29,10 @@ config_export () >> >> generate_test () >> { >> - local args=( $(escape "${@}") ) >> + local args=() >> + for arg in "${@}"; do >> + args+=("$(printf "%q" "$arg")") >> + done >> >> echo "#!/usr/bin/env bash" >> echo "export STANDALONE=yes" >> -- >> 2.13.3 >> > > Reviewed-by: Andrew Jones <drjones@redhat.com> >
diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh index a15941f75375..c1ecb7f99cdc 100755 --- a/scripts/mkstandalone.sh +++ b/scripts/mkstandalone.sh @@ -7,13 +7,6 @@ fi source config.mak source scripts/common.bash -escape () -{ - for arg in "${@}"; do - printf "%q " "$arg"; # XXX: trailing whitespace - done -} - temp_file () { local var="$1" @@ -36,7 +29,10 @@ config_export () generate_test () { - local args=( $(escape "${@}") ) + local args=() + for arg in "${@}"; do + args+=("$(printf "%q" "$arg")") + done echo "#!/usr/bin/env bash" echo "export STANDALONE=yes"
Spaces in an argument made the quoted result occupy multiple array fields after splitting. The test broke if the third argument was shifted because of that. (arm/gicv2*) Populate the array explicitly, instead of relying on splitting. Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> --- scripts/mkstandalone.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)