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
Ignore duplicate packages in metadata #1034
Conversation
4b22595
to
568eac0
Compare
Hi there, was wondering in which version of Pulp will this merge be included? Thank you! |
@pirxthepilot I believe it will be in 2.13 |
@@ -1022,6 +1017,8 @@ def _identify_wanted_versions(self, package_info_generator): | |||
|
|||
:param package_info_generator: iterator of pulp_rpm.plugins.db.models.Package | |||
instances | |||
:param return_count: Retur number of unique packages parsed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it is a bool it cannot return 'number of unique packages'
ret = {} | ||
for units in wanted.itervalues(): | ||
for unit, info in units.itervalues(): | ||
ret[unit] = info | ||
|
||
return ret | ||
return (ret, number_of_unique_packages) if return_count else ret |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since in this method the calculation of number of unique packages is ongoing anyway, i suggest to return always the tuple and ignore the second return value where it is needed, like in drpm case.
x, _ = return_multiple_values()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the above change would lead to removal of return_count
parameter
@@ -1080,6 +1082,8 @@ def _filtered_unit_generator(units, to_download=None): | |||
# assume we want to download everything | |||
yield unit | |||
elif unit.unit_key_as_named_tuple in to_download: | |||
# We don't need to download packages twice | |||
to_download.remove(unit.unit_key_as_named_tuple) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
niiice
@BrnoPCmaniak did you have a chance to test this with duplicate rpm/srpm/drpm? |
We can now sync from repository which have the same package more than once enlisted in the metadata. closes pulp#2605 https://pulp.plan.io/issues/2605
568eac0
to
4bc2615
Compare
Fixed but unable to test due to outage my vagrant fedora don't want to install. |
ok test |
@BrnoPCmaniak I still get the error: I tried to sync with: |
i tested against 2.12-dev with this PR
|
@ipanova i tested it only with pulp 2.12.2 release from https://repos.fedorapeople.org/repos/pulp/pulp/stable/2/7/x86_64/. Thanks |
We can now sync from repository which have the same package more than
once enlisted in the metadata.
closes #2605
https://pulp.plan.io/issues/2605