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

Allow substitution of user-defined variables in RPM preamble #787

Merged
merged 6 commits into from
Jan 2, 2024

Conversation

kellyma2
Copy link
Contributor

It's desirable to be able to parameterize some variables in the preamble such as architecture when RPM packages. This change enables variable substitution in the preamble section so that the values may be injected in this fashion in lieu of only using statically defined values.

It's desirable to be able to parameterize some variables in the
preamble such as architecture when RPM packages.  This change enables
variable substitution in the preamble section so that the values may
be injected in this fashion in lieu of only using statically defined
values.
@kellyma2 kellyma2 changed the title eAllow substitution of user-defined variables in RPM preamble Allow substitution of user-defined variables in RPM preamble Nov 22, 2023
kellyma2 and others added 2 commits November 22, 2023 10:55
Currently we don't handle things like $(foo or (bar) correctly.
Lacking regex matching, we can compensate for this somewhat by
attempting to find matching pairs of $( and ) and failing if we see
the start of a variable declaration but not its termination.
Copy link
Collaborator

@cgrindel cgrindel left a comment

Choose a reason for hiding this comment

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

Overall, the changes look reasonable to me. Could you ping me when CI is green?

@kellyma2
Copy link
Contributor Author

Will do!

Copy link
Collaborator

@aiuto aiuto left a comment

Choose a reason for hiding this comment

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

The PR description doesn't seem to match the code at all. It looks like the code just adds some safety against someone mis-typing a variable like $(foo} something (bar) .

@kellyma2
Copy link
Contributor Author

The PR description doesn't seem to match the code at all. It looks like the code just adds some safety against someone mis-typing a variable like $(foo} something (bar) .

The initial PR + first commit match up. When the CI job ran to test the initial changes, it hit the former case that the second commit fixes.

@aiuto aiuto merged commit c3a1ffb into bazelbuild:main Jan 2, 2024
2 checks passed
@kellyma2 kellyma2 deleted the preamble-substitute branch February 17, 2024 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants