From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPRLS-0006O2-PA for qemu-devel@nongnu.org; Tue, 19 Jul 2016 05:29:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPRLP-0006D7-LD for qemu-devel@nongnu.org; Tue, 19 Jul 2016 05:29:42 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:38083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPRLP-0006Cv-5g for qemu-devel@nongnu.org; Tue, 19 Jul 2016 05:29:39 -0400 Received: by mail-wm0-x22c.google.com with SMTP id o80so19127594wme.1 for ; Tue, 19 Jul 2016 02:29:39 -0700 (PDT) References: <1468916208-18668-1-git-send-email-famz@redhat.com> <1468916208-18668-4-git-send-email-famz@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1468916208-18668-4-git-send-email-famz@redhat.com> Date: Tue, 19 Jul 2016 10:29:39 +0100 Message-ID: <87lh0ym0vw.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v6 3/8] tests/docker/docker.py: check and run .pre script List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org Fam Zheng writes: > From: Alex Bennée > > 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 > Message-id: 1468335639-24582-4-git-send-email-alex.bennee@linaro.org > --- > tests/docker/docker.py | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/tests/docker/docker.py b/tests/docker/docker.py > index 96d906e..b61d934 100755 > --- a/tests/docker/docker.py > +++ b/tests/docker/docker.py > @@ -221,6 +221,18 @@ 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): > + rc = subprocess.call(os.path.realpath(docker_pre), > + cwd=docker_dir) > + if rc == 3: > + print "Skip" > + return 0 > + else: > + print "%s exited with code %d" % (docker_pre, rc) > + return 1 > + We need to let an exit of 0 through ;-) > # Do we include a extra binary? > if args.include_executable: > _copy_binary_with_libs(args.include_executable, -- Alex Bennée