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

meson: Detect Linux distro and choose an appropriate init style #1372

Merged

Conversation

rdmark
Copy link
Member

@rdmark rdmark commented Aug 2, 2024

Use /etc/os-release to detect which Linux distro we are running on.

@rdmark rdmark linked an issue Aug 2, 2024 that may be closed by this pull request
@rdmark rdmark force-pushed the 1270-meson-granular-linux-distro-detection-for-init-style-logic branch 2 times, most recently from bd66215 to d22995e Compare August 2, 2024 13:48
@rdmark
Copy link
Member Author

rdmark commented Aug 2, 2024

There are surely other Linux distros that are worth detecting, but I used the ones that I have handy to actually test.

@rdmark rdmark force-pushed the 1270-meson-granular-linux-distro-detection-for-init-style-logic branch from d22995e to 631d7b3 Compare August 2, 2024 23:35
Copy link

sonarcloud bot commented Aug 2, 2024

@rdmark
Copy link
Member Author

rdmark commented Aug 3, 2024

The distro detection here is fairly loose. I tried doing exact matches with e.g. ID=alpine but found that some distros put the id in quotation marks and some don't, while Meson does not support regular expression matching. So for now I do a global match for the distro keywords, which means that ID_LIKE fields will get matched too. For instance, Mint will be detected as Ubuntu since I don't have an explicit check for Mint:

ID=linuxmint
ID_LIKE=ubuntu

@rdmark rdmark merged commit e107676 into main Aug 3, 2024
15 checks passed
@rdmark rdmark deleted the 1270-meson-granular-linux-distro-detection-for-init-style-logic branch August 3, 2024 00:05
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.

meson: Granular Linux distro detection for init style logic
1 participant