From patchwork Tue Jul 12 15:00:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 71859 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp524382qga; Tue, 12 Jul 2016 08:06:39 -0700 (PDT) X-Received: by 10.129.55.205 with SMTP id e196mr1910452ywa.243.1468335999077; Tue, 12 Jul 2016 08:06:39 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i26si1688014qte.95.2016.07.12.08.06.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 12 Jul 2016 08:06:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMzGg-0007AS-IS for patch@linaro.org; Tue, 12 Jul 2016 11:06:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMzB6-0008Jf-I4 for qemu-devel@nongnu.org; Tue, 12 Jul 2016 11:00:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMzB4-0007ki-DD for qemu-devel@nongnu.org; Tue, 12 Jul 2016 11:00:51 -0400 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:37843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMzB4-0007kb-79 for qemu-devel@nongnu.org; Tue, 12 Jul 2016 11:00:50 -0400 Received: by mail-wm0-x230.google.com with SMTP id i5so29035055wmg.0 for ; Tue, 12 Jul 2016 08:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k4MdGUq+iMDYP0FRr0xNOtY20Xc+P4mctMusvZ7qdXs=; b=KMIrhE4tFWEcokXH8tNgraOskhM4u12+EBnr0l1o/2ncXJiM/BYa+En40mezzLJ8fi 6Isq5mRtOpCmB4RiEDMX+Odh59E7jdjZuBM1N8NHz0bANUdEJr7m0brVxnEqf3jKUBNp TTpG4M1HJ6bF9+KpoWUObINMP5w4tlM4AYOMY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k4MdGUq+iMDYP0FRr0xNOtY20Xc+P4mctMusvZ7qdXs=; b=hNr4WdckgRSpdIARhq/fI8/q4KLbnulL8dBluDp/i4gVnxfogBV14W9q9ynfbjCvyH A6B4L3xPa7pMeYt6XoRXZLwNUNUsH9stLmPOeoYGp81YyQ6o0nfsBi3YmC1MtH9YBaSu DmoRBgU30eG7fuemJByU2oR++wWtPmgUWsbQNnUbNgtH/D4TDlJWn0oh4s/yBXngtyl+ GaCrCe4ZYww0MtDAycap5UVnGUlhBPuWmmfI5TZ66GZUnk2iINJqFB/H262OWIIDyydq azS3lpfPcv9b7dc5L8fYFofBgOsGEH5kUiPVWTkER9LVt7HXPEMlyagVaQNAftnegpWP QjRg== X-Gm-Message-State: ALyK8tLJqGHmesTjThTya7z6hR1CRVKQW3B7ODntd8PLjxsJA1ng7WvzUZDaEMIMOxRrJ7cy X-Received: by 10.28.96.11 with SMTP id u11mr4242502wmb.5.1468335649440; Tue, 12 Jul 2016 08:00:49 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d64sm2466397wmc.22.2016.07.12.08.00.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jul 2016 08:00:47 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 236213E0426; Tue, 12 Jul 2016 16:00:49 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 12 Jul 2016 16:00:35 +0100 Message-Id: <1468335639-24582-4-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468335639-24582-1-git-send-email-alex.bennee@linaro.org> References: <1468335639-24582-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::230 Subject: [Qemu-devel] [PATCH v5 3/7] tests/docker/docker.py: check and run .pre 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , riku.voipio@linaro.org, famz@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The docker script will now search for an associated $dockerfile.pre script which gets run in the same build context as the dockerfile will be. This is to support pre-seeding the build context before running the docker build. Signed-off-by: Alex Bennée --- v3 - new for v3, split from previous patch - use check_call when running the pre-script --- tests/docker/docker.py | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.7.4 diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 96d906e..244901d 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -221,6 +221,12 @@ class BuildCommand(SubCommand): # Create a docker context directory for the build docker_dir = tempfile.mkdtemp(prefix="docker_build") + # Is there a .pre file to run in the build context? + docker_pre = os.path.splitext(args.dockerfile)[0]+".pre" + if os.path.exists(docker_pre): + subprocess.check_call(os.path.realpath(docker_pre), + cwd=docker_dir) + # Do we include a extra binary? if args.include_executable: _copy_binary_with_libs(args.include_executable,