From 1cf4a9b8d89b91d07a5a0d67ee710473ac1dfd94 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 11 Jan 2019 13:02:04 +1100 Subject: [PATCH] waf: fixed ROMFS compression to use zero timestamp this makes the apj file indepenent of build date, which fixes this issue: https://discuss.ardupilot.org/t/arducopter-waf-build-repeatability/37182 --- Tools/ardupilotwaf/embed.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tools/ardupilotwaf/embed.py b/Tools/ardupilotwaf/embed.py index 0b6d970171..db4da24d44 100644 --- a/Tools/ardupilotwaf/embed.py +++ b/Tools/ardupilotwaf/embed.py @@ -23,8 +23,10 @@ def embed_file(out, f, idx): # compress it compressed = tempfile.NamedTemporaryFile() - with gzip.open(compressed.name, mode='wb', compresslevel=9) as g: + f = open(compressed.name, "wb") + with gzip.GzipFile(fileobj=f, mode='wb', filename='', compresslevel=9, mtime=0) as g: g.write(contents) + f.close() compressed.seek(0) b = bytearray(compressed.read())