-
Notifications
You must be signed in to change notification settings - Fork 44
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
Checks whether the rootfs has UDI or Subiquity snaps #249
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy
in the new code
clang-format
found formatting issues in the code submitted.:warning:
Make sure to run clang-format and update this pull request.
(1/1)
Let's place there those small bits that resemble std algorithms. They seem very useful to be tied to one namespace. Also, made them templates, to deal with char and wchar_t. Moves concat as well
Both ubuntu-desktop-installer and subiquity. For now only the first is relevant. Soon the second will be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy
in the new code
clang-format
found formatting issues in the code submitted.:warning:
Make sure to run clang-format and update this pull request.
(1/1)
// Common algorithms to be used everywhere in the launcher project with style resembling the std ones. | ||
|
||
template <typename CharT> | ||
bool starts_with(const std::basic_string_view<CharT> tested, const std::basic_string_view<CharT> start) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 adjacent parameters of starts_with
of similar type (const std::basic_string_view<CharT>
) are easily swapped by mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed somewhat bug prone, but those are the only parameters the function accept, I don't see other way to do it :D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
In the future maybe we should refactor a bit and put all algorithms
tests in their own test suite.
Also, some functions around the codebase might be better here as well. Things like wide_string_to_utf8
, or safe_execute
as quick examples.
That I'd say is outside the scope of this PR, so approving.
I like the idea. |
Currently only checking for UDI is relevant. Soon Subiquity-only will be as well, which will break the possibility of rendering a GUI from inside Linux, since there will be no GUI there anymore.
Thus, this pull request modifies the function that checks whether the distro is GUI-enabled to check for the existence of the UDI snap.
Since I wanted to reuse your implementation of
starts|ends_with
algorithms, I created a new header to host them (plus some other bits with similar scope).