Skip to content

Commit 433504f

Browse files
authored
tar_writer.py: address duplicate dir warning regression (#900)
* `tar_writer.py`: address duplicate dir warning regression * `tar_writer.py`: comment dir dup check * `tar_writer.py`: omit warning for duplicate dirs
1 parent 8d25237 commit 433504f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/private/tar/tar_writer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,12 @@ def _addfile(self, info, fileobj=None):
130130
if not info.name.endswith('/'):
131131
info.name += '/'
132132
if not self.allow_dups_from_deps and self._have_added(info.name):
133+
# Directories with different contents should get merged without warnings.
134+
# If they have overlapping content, the warning will be on their duplicate *files* instead
135+
if info.type != tarfile.DIRTYPE:
133136
print('Duplicate file in archive: %s, '
134137
'picking first occurrence' % info.name)
135-
return
138+
return
136139

137140
self.tar.addfile(info, fileobj)
138141
self.members.add(info.name)

0 commit comments

Comments
 (0)