Skip to content

Refs #18539 - Introduce foreman_plugin_files in foreman.macros#11190

Draft
ekohl wants to merge 1 commit intotheforeman:rpm/developfrom
ekohl:rpm/develop-18539-introduce-plugin-files-in-macro
Draft

Refs #18539 - Introduce foreman_plugin_files in foreman.macros#11190
ekohl wants to merge 1 commit intotheforeman:rpm/developfrom
ekohl:rpm/develop-18539-introduce-plugin-files-in-macro

Conversation

@ekohl
Copy link
Copy Markdown
Member

@ekohl ekohl commented Aug 30, 2024

This allows plugins to use %files -f foreman_plugin_files and automatically get the correct files section, based on the foreman_bundlerd_file and foreman_precompile_plugin macros (and their options).

@evgeni
Copy link
Copy Markdown
Member

evgeni commented Aug 30, 2024

But this also means we need to adjust every single plugin spec, while just adjusting the existing macros does not require it?

@ekohl
Copy link
Copy Markdown
Member Author

ekohl commented Aug 30, 2024

True, but the idea I have is to and up with less logic in gem2rpm/foreman_plugin.spec.erb anyway. Combined with #8414 I'd like to get rid of a lot of templating.

Perhaps it's better to separate that out, but I wanted to see. Friday always has time for a bit of experimentation, right?

This allows plugins to use %files -f foreman_plugin_files and
automatically get the correct files section, based on the
foreman_bundlerd_file and foreman_precompile_plugin macros (and their
options).
@ekohl ekohl force-pushed the rpm/develop-18539-introduce-plugin-files-in-macro branch from 5198019 to 133fd0e Compare August 30, 2024 10:24
Copy link
Copy Markdown
Member Author

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I've become convinced this is getting too complex and we should really take it as a bigger step.

# -n<plugin_name> Overrides default of gem_name
%%%{name}_bundlerd_file(n:) \\
mkdir -p %%{buildroot}%%{%{name}_bundlerd_dir} \\
echo %%{%{name}_bundlerd_dir}/%%{-n*}%%{!?-n:%%{gem_name}} >> %%%{name}_plugin_files \\
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note to self: this and other cases need to be

Suggested change
echo %%{%{name}_bundlerd_dir}/%%{-n*}%%{!?-n:%%{gem_name}} >> %%%{name}_plugin_files \\
echo %%{%{name}_bundlerd_dir}/%%{-n*}%%{!?-n:%%{gem_name}} >> %{name}_plugin_files \\

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