Skip to content

Commit

Permalink
Merge pull request #330 from rajulkumar/fix_copy_repo
Browse files Browse the repository at this point in the history
Fixed copy_repo copied all content types when copying only rpms
  • Loading branch information
rajulkumar authored Dec 23, 2024
2 parents 35eea0c + 4212bf1 commit 1317f6e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pubtools/_pulp/tasks/copy_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,14 @@ def str_to_content_type(content_type_id):
# criteria for all non-rpm content types
# unit_fields are ignored as they are small in size and the repos have
# small unit counts for non-rpm content types
criteria.append(
Criteria.with_field(
"content_type_id", Matcher.in_(sorted(non_rpm_content_types))
if non_rpm_content_types:
# type_id filter with empty list includes all the content types.
# hence, check for the presence of non-rpm content types.
criteria.append(
Criteria.with_field(
"content_type_id", Matcher.in_(sorted(non_rpm_content_types))
)
)
)

# criteria for rpm content types
# unit_fields to keep a check on memory consumption with large rpm unit
Expand Down

0 comments on commit 1317f6e

Please sign in to comment.