mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
use python's built in platform module for detection, for more accuracy and cross platform support
This commit is contained in:
parent
088963f774
commit
939f409042
1 changed files with 4 additions and 2 deletions
|
@ -13,6 +13,8 @@ import contextlib
|
||||||
import subprocess
|
import subprocess
|
||||||
from subprocess import PIPE
|
from subprocess import PIPE
|
||||||
import sys
|
import sys
|
||||||
|
import platform
|
||||||
|
|
||||||
import toml
|
import toml
|
||||||
|
|
||||||
from mach.registrar import Registrar
|
from mach.registrar import Registrar
|
||||||
|
@ -32,7 +34,7 @@ def cd(new_path):
|
||||||
|
|
||||||
|
|
||||||
def host_triple():
|
def host_triple():
|
||||||
os_type = subprocess.check_output(["uname", "-s"]).strip().lower()
|
os_type = platform.system().lower()
|
||||||
if os_type == "linux":
|
if os_type == "linux":
|
||||||
os_type = "unknown-linux-gnu"
|
os_type = "unknown-linux-gnu"
|
||||||
elif os_type == "darwin":
|
elif os_type == "darwin":
|
||||||
|
@ -44,7 +46,7 @@ def host_triple():
|
||||||
else:
|
else:
|
||||||
os_type = "unknown"
|
os_type = "unknown"
|
||||||
|
|
||||||
cpu_type = subprocess.check_output(["uname", "-m"]).strip().lower()
|
cpu_type = platform.machine().lower()
|
||||||
if cpu_type in ["i386", "i486", "i686", "i768", "x86"]:
|
if cpu_type in ["i386", "i486", "i686", "i768", "x86"]:
|
||||||
cpu_type = "i686"
|
cpu_type = "i686"
|
||||||
elif cpu_type in ["x86_64", "x86-64", "x64", "amd64"]:
|
elif cpu_type in ["x86_64", "x86-64", "x64", "amd64"]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue