diff mbox series

[RFC,1/3] docker: docker.py don't conflate checksums for extra_files

Message ID 20180608160432.8734-2-alex.bennee@linaro.org
State Superseded
Headers show
Series Better docker dependency checking | expand

Commit Message

Alex Bennée June 8, 2018, 4:04 p.m. UTC
This just gets confusing especially as the helper function doesn't
even take into account any extra files (or the executable). Currently
the actual check just ignores them and also passes the result through
_dockerfile_preprocess so we fix that too.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 tests/docker/docker.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

-- 
2.17.1
diff mbox series

Patch

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 37bfa98005..80efa641c5 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -200,8 +200,10 @@  class Docker(object):
 
         tmp_df.write("\n")
         tmp_df.write("LABEL com.qemu.dockerfile-checksum=%s" %
-                     _text_checksum("\n".join([dockerfile] +
-                                    extra_files_cksum)))
+                     _text_checksum(_dockerfile_preprocess(dockerfile)))
+        for f, c in extra_files_cksum:
+            tmp_df.write("LABEL com.qemu.%s-checksum=%s" % (f, c))
+
         tmp_df.flush()
 
         self._do_check(["build", "-t", tag, "-f", tmp_df.name] + argv + \
@@ -316,7 +318,7 @@  class BuildCommand(SubCommand):
                 _copy_binary_with_libs(args.include_executable, docker_dir)
             for filename in args.extra_files or []:
                 _copy_with_mkdir(filename, docker_dir)
-                cksum += [_file_checksum(filename)]
+                cksum += [(filename, _file_checksum(filename))]
 
             argv += ["--build-arg=" + k.lower() + "=" + v
                         for k, v in os.environ.iteritems()