Conversation
caea9df to
8fbb446
Compare
|
Can one of the reviewers with write access review this pull request, please? |
fd0aa52 to
169c76e
Compare
Signed-off-by: Markus Urbanczyk <markus.urbanczyk@evosoft.com>
169c76e to
482f506
Compare
| # Strip off all content that contains Obsoleting, Security: or Update | ||
| body = str.partition(/^(Obsoleting|Security:|Update)/).first | ||
|
|
||
| body = body.gsub(/^Upgrades.*?$/m, '') |
There was a problem hiding this comment.
| body = body.gsub(/^Upgrades.*?$/m, '') | |
| body = body.gsub(/^Upgrades.*?$/m, '') | |
I would keep the empty newline after the body modifications.
| body = body.gsub(/^Upgrades.*?$/m, '') | |
| body.gsub!(/^Upgrades.*?$/m, '') | |
@OpenVoxProject do you prefer the in-place gsub call?
There was a problem hiding this comment.
@muald I just learnt that in Ruby RegExp the anchors ^ and $ match in m mode actually at the line boundaries and not at the string boundaries (according to the back of my head this used to be different... in Python). This means, due to the $ anchor the match will definitely anchor at the end of the first line. As we want the whole first line gone, we then probably don't need the non-greedy ?.
But we definitely need the m mode otherwise $ would anchor at the end of the whole body string.
We do leave an empty newline after the substitution.
Alternatively, without m mode, we could also do this:
| body = body.gsub(/^Upgrades.*?$/m, '') | |
| # https://regex101.com/r/LiVD53/2/substitution | |
| body.gsub!(/^Upgrades.*\R/, '') | |
This would remove only the whole first line of the body, if it starts with Upgrades.
@bastelfreak what do you think?
nsballmann
left a comment
There was a problem hiding this comment.
@muald I would probably go with the suggestion from #613 (comment) as this IMHO is the cleanest way of removing the line.
Short description
Remove the Upgrades header. The update process in Fedora 44 was blocked by this header.
#555 (comment)
The header was introduced 7 months ago.
https://github.com/rpm-software-management/dnf5/blob/main/dnf5/commands/check-upgrade/check-upgrade.cpp#L211
Checklist
I have:
Signed-off-byannotation to each of my commitsGenerated-byorAssisted-byannotations to each of my commits created with the help of an AI agent