Detect Ubuntu by checking release() and uname() (#13704)
This will improve detection of Ubuntu when running on Ubuntu on WSL. #13703
This commit is contained in:
parent
dae9865b14
commit
f4dbdd311f
1 changed files with 3 additions and 1 deletions
|
|
@ -156,7 +156,9 @@ proc detectOsImpl(d: Distribution): bool =
|
||||||
of Distribution.Posix: result = defined(posix)
|
of Distribution.Posix: result = defined(posix)
|
||||||
of Distribution.MacOSX: result = defined(macosx)
|
of Distribution.MacOSX: result = defined(macosx)
|
||||||
of Distribution.Linux: result = defined(linux)
|
of Distribution.Linux: result = defined(linux)
|
||||||
of Distribution.Ubuntu, Distribution.Gentoo, Distribution.FreeBSD,
|
of Distribution.Ubuntu:
|
||||||
|
result = "Ubuntu" in release() or ("-" & $d & " ") in uname()
|
||||||
|
of Distribution.Gentoo, Distribution.FreeBSD,
|
||||||
Distribution.OpenBSD:
|
Distribution.OpenBSD:
|
||||||
result = ("-" & $d & " ") in uname()
|
result = ("-" & $d & " ") in uname()
|
||||||
of Distribution.RedHat:
|
of Distribution.RedHat:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue