From 2dce6d048edf41227efa59c0b32cc2dd6ecd8fb3 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 20 Jul 2022 12:51:58 +0200 Subject: [PATCH] [IMP] runbot: freeze files modification time at export When exporting a commit, it will be useful to freeze the modification time of the exported files. The idea behind that is to pre-generate bundles at the install time of the Odoo instances, that way when running the post install tests, the bundles does not have to be generated for each test. --- runbot/models/commit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot/models/commit.py b/runbot/models/commit.py index 088e8058..ae565ea0 100644 --- a/runbot/models/commit.py +++ b/runbot/models/commit.py @@ -75,7 +75,7 @@ class Commit(models.Model): self.rebase_on_id.repo_id._fetch(export_sha) p1 = subprocess.Popen(['git', '--git-dir=%s' % self.repo_id.path, 'archive', export_sha], stderr=subprocess.PIPE, stdout=subprocess.PIPE) - p2 = subprocess.Popen(['tar', '-xmC', export_path], stdin=p1.stdout, stdout=subprocess.PIPE) + p2 = subprocess.Popen(['tar', '--mtime', self.date.strftime('%Y-%m-%d %H:%M:%S'), '-xC', export_path], stdin=p1.stdout, stdout=subprocess.PIPE) p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits. (_, err) = p2.communicate() p1.poll() # fill the returncode