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

add kylin support for linuxos module #5834

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions xmake/core/base/linuxos.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
Loading