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

keyfile-utils: Add API to parse tristate strings #3276

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

cgwalters
Copy link
Member

Prep for using this in multiple places. Add unit tests.

Prep for using this in multiple places. Add unit tests.
@cgwalters cgwalters enabled auto-merge July 10, 2024 22:04
gboolean
_ostree_parse_tristate (const char *s, OtTristate *out_tri, GError **error)
{
if (strcmp (s, "maybe") == 0)
Copy link
Member

Choose a reason for hiding this comment

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

This isn't new, but "maybe" is a very confusing value to support. Feels like "auto" would capture it better?

return TRUE;
}
// If it's invalid, be clear a tristate was expected.
return glnx_throw (error, "Invalid tri-state value: %s", s);
Copy link
Member

Choose a reason for hiding this comment

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

Minor: looks like we're losing the G_KEY_FILE_ERROR_INVALID_VALUE semantics here.

@cgwalters cgwalters merged commit 5378fe2 into ostreedev:main Jul 11, 2024
24 of 25 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.

2 participants