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

Convert rpmrc data structures to STL #3489

Merged
merged 9 commits into from
Dec 18, 2024

Conversation

pmatilai
Copy link
Member

Fun times. There's plenty of room for further cleanup + improvement, but this is plenty for one review...

Our test-suite currently always runs on x86_64, so we can make some
assumptions here. We can't test exact values though, because we don't
know what kind of hardware it might execute on, giving different values
for the different x86_64_v* levels. So just test that the relative
values makes sense.
@pmatilai pmatilai requested a review from a team as a code owner December 13, 2024 13:02
@pmatilai pmatilai requested review from ffesti and removed request for a team December 13, 2024 13:02
@pmatilai
Copy link
Member Author

Argh, of course /etc/rpm/platform location depends on the cmake prefix, which differs between CI and my local build, that's why the test fails. Guess that'll have to wait to next week...

@pmatilai pmatilai marked this pull request as draft December 13, 2024 13:48
There are various places that need this, the next test being just one of
them.
We don't want to maintain a set of duplicate macro values in the
test-suite so trim the --showrc output to the start where the
arch/os/rpmrc stuff is.
This was maintained as an dynamic array with brute-force lookup, but
the actual use-case is a simple string:string map.
This was maintained as an dynamic array with brute-force lookup, but
the actual use-case is a simple string:string map.
This should really just use an map of some sort instead of a vector,
but the search is case insensitive so punting dealing with that to
some other time.
Beneath all the C tedium, it's really just a simple map to a struct
that has a further embedded array.
The old code seemed to support variables that are not arch specific,
but none of such items are left so we don't need to care about that
case. So we might as well use { var, arch } as the key, but that
is annoying in a different way.
@pmatilai pmatilai marked this pull request as ready for review December 13, 2024 14:03
@pmatilai
Copy link
Member Author

Wasn't that bad afterall, and we'll need ede6ec2 for various other purposes too.

@ffesti ffesti merged commit 4d621e4 into rpm-software-management:master Dec 18, 2024
1 check 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.

2 participants