Repository navigation
Fix package on Fedora 44 by ignoring unexpected Upgrades DNF5 header
#681
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -133,7 +133,7 @@ def self.check_updates(disablerepo, enablerepo, disableexcludes) | |||||||||||||||||||||
| def self.parse_updates(str) | ||||||||||||||||||||||
| # Strip off all content that contains Obsoleting, Security: or Update | ||||||||||||||||||||||
| body = str.partition(/^(Obsoleting|Security:|Update)/).first | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| body = body.gsub(/^Upgrades.*?$/m, '') | ||||||||||||||||||||||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I would keep the empty newline after the body modifications.
Suggested change
@OpenVoxProject do you prefer the in-place
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @muald I just learnt that in Ruby But we definitely need the We do leave an empty newline after the substitution. Alternatively, without
Suggested change
This would remove only the whole first line of the body, if it starts with @bastelfreak what do you think? |
||||||||||||||||||||||
| updates = Hash.new { |h, k| h[k] = [] } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| body.split(/^\s*\n/).each do |line| | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Updating and loading repositories: | ||
| Repositories loaded. | ||
| Upgrades | ||
| curl.x86_64 8.18.0-14.fc44 updates |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Updating and loading repositories: | ||
| Repositories loaded. | ||
| Upgrades (available for reinstall, available for upgrade) | ||
| curl.x86_64 8.18.0-10.fc44 updates |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Updating and loading repositories: | ||
| Repositories loaded. | ||
| curl.x86_64 8.15.0-10.fc43 updates |
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.
Wouldn't it work to add
Upgradesto this?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.
@bastelfreak sorry for not responding that long. It was really a lengthy... Cyber Awareness October...
I'm no Ruby expert, but no I don't think this would work. In my understanding
.partition()splits the whole content into partitions. I think the.firstwould then give the first element of the resulting array and due to the new header this would by an empty partition before the partition we're interested in, due to the new (unexpected) dividing element.I think that's the reason @muald chose to modify
body.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.
Either way,
.partitionis returning some empty strings. Have you considered just filtering them out with.reject!(&:empty?)?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.
@binford2k as stated in #555 (comment) I would go for using the
--jsonparameter (when available, else fall back to current behavior) if I had the time to rewrite. IMHO this would be a robuster approach.In my understanding this PR is more a quick fix for the non-JSON based parsing. So I wouldn't want to pour too much energy into this.