From 208b2b4006aa5f415a901cfe4e28a8cae5ba7932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Tue, 7 Apr 2020 14:38:45 +0200 Subject: _casbaseddirectory.py: Sort entries in export_to_tar() We want to ensure the output is deterministic. --- src/buildstream/storage/_casbaseddirectory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/buildstream') diff --git a/src/buildstream/storage/_casbaseddirectory.py b/src/buildstream/storage/_casbaseddirectory.py index 43d5e8224..b8b5ca09c 100644 --- a/src/buildstream/storage/_casbaseddirectory.py +++ b/src/buildstream/storage/_casbaseddirectory.py @@ -536,7 +536,7 @@ class CasBasedDirectory(Directory): self.cas_cache.checkout(to_directory, self._get_digest(), can_link=can_link) def export_to_tar(self, tarfile, destination_dir, mtime=BST_ARBITRARY_TIMESTAMP): - for filename, entry in self.index.items(): + for filename, entry in sorted(self.index.items()): arcname = os.path.join(destination_dir, filename) if entry.type == _FileType.DIRECTORY: tarinfo = tarfilelib.TarInfo(arcname) -- cgit v1.2.1