diff options
| author | jinke18 <[email protected]> | 2024-11-16 10:57:15 +0800 |
|---|---|---|
| committer | jinke18 <[email protected]> | 2024-11-16 10:57:15 +0800 |
| commit | cb8755fab947a8c1d68fb3be9958e508e1927aed (patch) | |
| tree | 993299bb8de89131ee417927618af95e501bddb6 /xmake/core/base/linuxos.lua | |
| parent | fce49a0940ba7b950d37b5d0ad1217614c6e2bd5 (diff) | |
add kylin support for linuxos module
Diffstat (limited to 'xmake/core/base/linuxos.lua')
| -rw-r--r-- | xmake/core/base/linuxos.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/core/base/linuxos.lua b/xmake/core/base/linuxos.lua index 00b4a90f4..a397d95fe 100644 --- a/xmake/core/base/linuxos.lua +++ b/xmake/core/base/linuxos.lua @@ -97,6 +97,9 @@ function linuxos.name() name = "deepin" elseif os_release:find("linux mint", 1, true) or os_release:find("linuxmint", 1, true) then name = "linuxmint" + -- kylin contains keyword 'UBUNTU_CODENAME', so we check kylin before ubuntu + elseif os_release:find("kylin", 1, true) then + name = "kylin" elseif os_release:find("ubuntu", 1, true) then name = "ubuntu" elseif os_release:find("debian", 1, true) then @@ -145,6 +148,7 @@ function linuxos.version() -- ubuntu: VERSION="16.04.7 LTS (Xenial Xerus)" -- fedora: VERSION="32 (Container Image)" -- debian: VERSION="9 (stretch)" + -- kylin : VERSION="V10(kylin)" if line:find("version=") then line = line:sub(9) version = semver.match(line) @@ -154,6 +158,13 @@ function linuxos.version() version = semver.new(version .. ".0") end end + -- is kylin? + if not version and line:find("kylin", 1, true) then + version = line:match("\"v(%d+)%(kylin%)\"") + if version then + version = semver.new(version .. ".0") + end + end if version then break end |
