summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-04-07 14:50:39 +0200
committerbst-marge-bot <marge-bot@buildstream.build>2020-04-08 06:57:57 +0000
commitc6b644653f83e7ff4d357c08ae97e0cd3306a9bd (patch)
treeefcd347c65859b06039a4e3df815dc0b9c1163d5
parent208b2b4006aa5f415a901cfe4e28a8cae5ba7932 (diff)
downloadbuildstream-c6b644653f83e7ff4d357c08ae97e0cd3306a9bd.tar.gz
_filebaseddirectory.py: Clear uid/gid/uname/gname in export_to_tar()
We want to ensure the output is deterministic.
-rw-r--r--src/buildstream/storage/_filebaseddirectory.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/buildstream/storage/_filebaseddirectory.py b/src/buildstream/storage/_filebaseddirectory.py
index 1500dd78e..c492c41cd 100644
--- a/src/buildstream/storage/_filebaseddirectory.py
+++ b/src/buildstream/storage/_filebaseddirectory.py
@@ -190,6 +190,10 @@ class FileBasedDirectory(Directory):
arcname = os.path.join(destination_dir, filename)
tarinfo = tarfile.gettarinfo(source_name, arcname)
tarinfo.mtime = mtime
+ tarinfo.uid = 0
+ tarinfo.gid = 0
+ tarinfo.uname = ""
+ tarinfo.gname = ""
if tarinfo.isreg():
with open(source_name, "rb") as f: