Skip to content

Commit

Permalink
Small adjustments to changelog limiting
Browse files Browse the repository at this point in the history
Sort the changelog entries by date first. I was hoping this wasn't
necessary since both legacy createrepo and createrepo_c use a specific
order, but I discovered that Oracle Linux used to use reverse
chronological order. I have no idea what tool they used but lets play
it safe for now

closes #2363
#2363

(cherry picked from commit cd7fc14)
  • Loading branch information
dralley committed Jan 21, 2022
1 parent e823864 commit c64595b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/2363.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an edge case with the changelog limit.
3 changes: 3 additions & 0 deletions pulp_rpm/app/metadata_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def process_other_package_element(element):
text = subelement.text
changelogs.append((author, date, text))

# make sure the changelogs are sorted by date
changelogs.sort(key=lambda t: t[1])

if settings.KEEP_CHANGELOG_LIMIT is not None:
# always keep at least one changelog, even if the limit is set to 0
changelog_limit = settings.KEEP_CHANGELOG_LIMIT or 1
Expand Down

0 comments on commit c64595b

Please sign in to comment.