From patchwork Wed Jul 26 08:39:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 9864421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 72D926038C for ; Wed, 26 Jul 2017 08:39:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61C42281B7 for ; Wed, 26 Jul 2017 08:39:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 562F128737; Wed, 26 Jul 2017 08:39:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,HK_RANDOM_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 255D8281B7 for ; Wed, 26 Jul 2017 08:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751561AbdGZIjW (ORCPT ); Wed, 26 Jul 2017 04:39:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41612 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751503AbdGZIjV (ORCPT ); Wed, 26 Jul 2017 04:39:21 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 60058C04D293 for ; Wed, 26 Jul 2017 08:39:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 60058C04D293 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=rkrcmar@redhat.com Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id AAE05612A6; Wed, 26 Jul 2017 08:39:19 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Wed, 26 Jul 2017 10:39:18 +0200 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: kvm@vger.kernel.org Cc: Paolo Bonzini , Andrew Jones Subject: [kvm-unit-tests PATCH] scripts/mkstandalone: fix quoting Date: Wed, 26 Jul 2017 10:39:09 +0200 Message-Id: <20170726083909.30029-1-rkrcmar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 26 Jul 2017 08:39:21 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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ář Reviewed-by: Andrew Jones --- 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"