Skip to content

Use the RPM built-in sysusers feature #171

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

Merged
merged 1 commit into from
Jun 11, 2025
Merged

Use the RPM built-in sysusers feature #171

merged 1 commit into from
Jun 11, 2025

Conversation

praiskup
Copy link
Owner

@praiskup praiskup commented Feb 12, 2025

# `mock.conf` file in a package payload is sufficient to leverage this feature.
# However, for older distributions that lack this capability, we still define
# the %%pre scriptlet.
%if (0%{?rhel} && 0%{?rhel} < 10) || (0%{?mageia} && 0%{?mageia} < 10) || (0%{?suse_version} && 0%{?suse_version} < 1660)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Too bad there is no macro with RPM version because this is getting out of hand.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah. I just c&p'ed this from a place where people cared (mock), but I think we are just fine to support RHEL8+ and Fedora (if you think this is too ugly).

I think the problem is how to compare %rpmversion, without lua/bash heavy lifting...

Copy link
Owner Author

Choose a reason for hiding this comment

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

This is cool thing, btw.

$ rpm --eval '%[v"4.20.0" > v"4.19.0"]'
1

But this is RHEL9+ only: rpm-software-management/rpm@145b5f8

Copy link

Choose a reason for hiding this comment

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

Suggested change
%if (0%{?rhel} && 0%{?rhel} < 10) || (0%{?mageia} && 0%{?mageia} < 10) || (0%{?suse_version} && 0%{?suse_version} < 1660)
%if %{?rpmversion:v"%{rpmversion}" >= v"4.19"}%{!?rpmversion:0}

If the RPM version is too old for the comparison and this feature, it does not have the macro defined.

Copy link

Choose a reason for hiding this comment

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

Oh, my condition is reversed. But you get the idea.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And I already merged the PR. But good suggestion. Thank you.

@FrostyX
Copy link
Collaborator

FrostyX commented Feb 12, 2025

The CI fails only for EPEL7 which we can IMHO disable now. But the error looks fixable

RPM build errors:
error: Installed (but unpackaged) file(s) found:
   /usr/lib/sysusers.d/resalloc-agent-spawner.conf

@praiskup
Copy link
Owner Author

I disabled EPEL 7 builds. CI is green now.

Copy link
Collaborator

@xsuchy xsuchy left a comment

Choose a reason for hiding this comment

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

+1

@xsuchy xsuchy merged commit 5905e46 into main Jun 11, 2025
3 checks passed
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.

4 participants