diff options
| author | ruki <[email protected]> | 2024-11-16 13:16:09 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-11-16 13:16:09 +0800 |
| commit | 4778eb29d31ce7745e75f0b74c71cc9c93b469af (patch) | |
| tree | db3f17c9a3d01d20a58c253e7e137dd4095f5462 | |
| parent | 25e5ad87354dacbe29007d9e145f205a1d1984f8 (diff) | |
| parent | cb8755fab947a8c1d68fb3be9958e508e1927aed (diff) | |
Merge pull request #5834 from jinke18/dev-jk7
add kylin support for linuxos module
| -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 |
