From patchwork Mon Jul 11 03:20:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 9222883 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 91512608A7 for ; Mon, 11 Jul 2016 03:21:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 866811FFAD for ; Mon, 11 Jul 2016 03:21:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79EA12793D; Mon, 11 Jul 2016 03:21:33 +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,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1642B27165 for ; Mon, 11 Jul 2016 03:21:32 +0000 (UTC) Received: from localhost ([::1]:57633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMRml-0003Vr-7S for patchwork-qemu-devel@patchwork.kernel.org; Sun, 10 Jul 2016 23:21:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMRmB-0003UR-9W for qemu-devel@nongnu.org; Sun, 10 Jul 2016 23:20:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMRm8-0002um-3g for qemu-devel@nongnu.org; Sun, 10 Jul 2016 23:20:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMRm7-0002ui-UB for qemu-devel@nongnu.org; Sun, 10 Jul 2016 23:20:52 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A1DB81110; Mon, 11 Jul 2016 03:20:51 +0000 (UTC) Received: from ad.usersys.redhat.com (dhcp-14-122.nay.redhat.com [10.66.14.122]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6B3Km7c023445; Sun, 10 Jul 2016 23:20:50 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Mon, 11 Jul 2016 11:20:39 +0800 Message-Id: <1468207242-5015-2-git-send-email-famz@redhat.com> In-Reply-To: <1468207242-5015-1-git-send-email-famz@redhat.com> References: <1468207242-5015-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 11 Jul 2016 03:20:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH RFC v4 1/4] docker: More sensible run script X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP It is very easy to figure out current directory and bash option from the execution, so do less in the Makefile invocation command line, and figure both options in the script. This makes the next patch easier. Signed-off-by: Fam Zheng --- tests/docker/Makefile.include | 4 +--- tests/docker/run | 12 +++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index f88c0a7..c5546ee 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -114,10 +114,8 @@ docker-run-%: docker-qemu-src -e CCACHE_DIR=/var/tmp/ccache \ -v $$(realpath $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \ -v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \ - -w /var/tmp/qemu \ qemu:$(IMAGE) \ - $(if $V,/bin/bash -x ,) \ - ./run \ + /var/tmp/qemu/run \ $(CMD); \ , " RUN $(CMD) in $(IMAGE)"))) diff --git a/tests/docker/run b/tests/docker/run index ec3d119..575e732 100755 --- a/tests/docker/run +++ b/tests/docker/run @@ -11,6 +11,12 @@ # or (at your option) any later version. See the COPYING file in # the top-level directory. +if test -n "$V"; then + set -x +fi + +BASE="$(dirname $(realpath $0))" + # Prepare the environment . /etc/profile || true export PATH=/usr/lib/ccache:$PATH @@ -24,10 +30,10 @@ export TEST_DIR=/tmp/qemu-test mkdir -p $TEST_DIR/{src,build,install} # Extract the source tarballs -tar -C $TEST_DIR/src -xzf qemu.tgz +tar -C $TEST_DIR/src -xzf $BASE/qemu.tgz for p in dtc pixman; do - if test -f $p.tgz; then - tar -C $TEST_DIR/src/$p -xzf $p.tgz + if test -f $BASE/$p.tgz; then + tar -C $TEST_DIR/src/$p -xzf $BASE/$p.tgz export FEATURES="$FEATURES $p" fi done