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

missing ID_LIKE in fedora #3

Open
plamenbotev opened this issue Aug 27, 2023 · 2 comments
Open

missing ID_LIKE in fedora #3

plamenbotev opened this issue Aug 27, 2023 · 2 comments

Comments

@plamenbotev
Copy link

plamenbotev commented Aug 27, 2023

Hi,

Thank you for the wonderful library. I have used it to experiment with ReactPHP as a replacement for the stream_select based event loop.
I am using Fedora 38 and do not have ID_LIKE in the os-release file.
Also looking at https://www.freedesktop.org/software/systemd/man/os-release.html, would it be a bit more stable if the ID is used instead or perhaps a combination of the two variables? :)
I have used something like the below code on my machine:

           $idLikeMap = [];
            if (isset($os['ID_LIKE'])) {
                $idLike = \explode(" ", \trim((string) $os['ID_LIKE']));
                $idLikeMap = array_combine(array_values($idLike), array_values($idLike));
            }

            $id = \trim((string) $os['ID']);

            $version = \trim((string) $os['VERSION_ID']);
            if ($id === 'debian' || isset($idLikeMap['debian'])) {
                $code = $directory . 'headers/uv_ubuntu' . ((float)$version < 20.04 ? '18.04' : '20.04') . '.h';
            } elseif ($id === 'redhat' || $id === 'fedora' ||  isset($idLikeMap['redhat']) || isset($ididLikeMapLike['fedora'])) {
                $code = $directory . 'headers/uv_centos' . ((float)$version < 8 ? '7' : '8+') . '.h';
            }

Best Regards

@TheTechsTech
Copy link
Member

Is that something removed from that version?

Anyway, you can do PR, my initial setup showed some issue, I don't remember what it was at this moment.

You can try both ways as long as nothing breaks. Maybe Fedora needs it's own detection logic.

@plamenbotev
Copy link
Author

Will test also on Fedora 37 and will open a pr, thanks. :)

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

No branches or pull requests

2 participants