Проверка на platform
This commit is contained in:
parent
67d90b8d94
commit
dc0a4ca234
21
pbuild.py
21
pbuild.py
|
@ -2,7 +2,6 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import platform
|
|
||||||
from multiprocessing import Pool
|
from multiprocessing import Pool
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,13 +95,19 @@ def check_limine():
|
||||||
|
|
||||||
|
|
||||||
def check_os():
|
def check_os():
|
||||||
current_os = platform.system().lower()
|
import platform
|
||||||
|
using_distro = False
|
||||||
if current_os == 'linux':
|
try:
|
||||||
dist = platform.linux_distribution()[0].lower()
|
import distro
|
||||||
|
using_distro = True
|
||||||
if dist == 'ubuntu' or dist == 'debian':
|
except ImportError:
|
||||||
return 1
|
pass
|
||||||
|
if using_distro:
|
||||||
|
linux_distro = distro.like()
|
||||||
|
else:
|
||||||
|
linux_distro = platform.linux_distribution()[0]
|
||||||
|
if linux_distro.lower( in ['debian', 'ubuntu']:
|
||||||
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def check_tools():
|
def check_tools():
|
||||||
|
|
Loading…
Reference in New Issue