Merge branch 'master' of bitbucket.org:yackob03/quay

This commit is contained in:
Jake Moshenko 2014-10-17 16:25:22 -04:00
commit ebacdec054

View file

@ -13,7 +13,7 @@ class TarfileAppender(TarLayerFormat):
super(TarfileAppender, self).__init__(self._get_tar_iterator)
self.entries = entries
self.base_tar_file = base_tar_file
self.last_info = None
self.first_info = None
def get_stream(self):
return GzipWrap(self.get_generator())
@ -22,7 +22,8 @@ class TarfileAppender(TarLayerFormat):
pass
def check_tar_info(self, tar_info):
self.last_info = tar_info
if not self.first_info:
self.first_info = tar_info
return True
def _get_tar_iterator(self):
@ -33,8 +34,11 @@ class TarfileAppender(TarLayerFormat):
# its data.
def add_entry(arch, dir_path, contents=None):
info = tarfile.TarInfo(dir_path)
info.uid = self.last_info.uid
info.gid = self.last_info.gid
info.uid = self.first_info.uid
info.gid = self.first_info.gid
info.mode = self.first_info.mode
info.mtime = self.first_info.mtime
info.type = tarfile.REGTYPE if contents else tarfile.DIRTYPE
if contents: