WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

missing ID_LIKE in fedora #3

@plamenbotev

Description

@plamenbotev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions