Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tar_writer.py: address duplicate dir warning regression #900

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkg/private/tar/tar_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,12 @@ def _addfile(self, info, fileobj=None):
if not info.name.endswith('/'):
info.name += '/'
if not self.allow_dups_from_deps and self._have_added(info.name):
# Directories with different contents should get merged without warnings.
# If they have overlapping content, the warning will be on their duplicate *files* instead
if info.type != tarfile.DIRTYPE:
print('Duplicate file in archive: %s, '
'picking first occurrence' % info.name)
return
return

self.tar.addfile(info, fileobj)
self.members.add(info.name)
Expand Down