Skip to content
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

Implement rich dependencies in gem2rpm templates #10025

Merged

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Nov 24, 2023

For most templates this is pretty straight forward, but for foreman_plugin.spec.erb it combines asset reequirements into the spec.extensions block. That was already using the more modern runtime_requirements.virtualize methods to generate a correct rpm dependency list. This was never noticed because we (thankfully) don't have foreman plugins with native extensions.

evgeni
evgeni previously approved these changes Nov 24, 2023
Copy link
Member

@evgeni evgeni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trust you… ;)

For most templates this is pretty straight forward, but for
foreman_plugin.spec.erb it combines asset reequirements into the
spec.extensions block.  That was already using the more modern
runtime_requirements.virtualize methods to generate a correct rpm
dependency list. This was never noticed because we (thankfully) don't
have foreman plugins with native extensions.
@ekohl ekohl force-pushed the rpm/develop-update-gem2rpm-with-rich-deps branch from e053547 to a7a0cbd Compare November 24, 2023 18:04
@ekohl
Copy link
Member Author

ekohl commented Nov 24, 2023

I've merged the block that requires gcc and declares it as noarch in a simple if/else condition. Hopefully the end blocks are a bit easier to follow now.

Comment on lines +70 to +71
<% build_requires = dep.requirement.map { |req| requirement(dep.name, req) } -%>
BuildRequires: <%= build_requires.size > 1 ? "(#{build_requires.join(' with ')})" : build_requires.first %>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fedora-ruby/gem2rpm#124 would make this:

Suggested change
<% build_requires = dep.requirement.map { |req| requirement(dep.name, req) } -%>
BuildRequires: <%= build_requires.size > 1 ? "(#{build_requires.join(' with ')})" : build_requires.first %>
BuildRequires: <%= dep.to_rich_rpm %>

@ekohl ekohl merged commit 401f5e2 into theforeman:rpm/develop Nov 24, 2023
1 check passed
@ekohl ekohl deleted the rpm/develop-update-gem2rpm-with-rich-deps branch November 24, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants