mirror of
https://github.com/0Nera/BMOSP.git
synced 2025-01-11 15:19:22 +03:00
Добавил проверку
This commit is contained in:
parent
e7255ee14d
commit
67d90b8d94
18
pbuild.py
18
pbuild.py
@ -2,6 +2,7 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
import platform
|
||||||
from multiprocessing import Pool
|
from multiprocessing import Pool
|
||||||
|
|
||||||
|
|
||||||
@ -93,6 +94,17 @@ def check_limine():
|
|||||||
os.chdir("..")
|
os.chdir("..")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def check_os():
|
||||||
|
current_os = platform.system().lower()
|
||||||
|
|
||||||
|
if current_os == 'linux':
|
||||||
|
dist = platform.linux_distribution()[0].lower()
|
||||||
|
|
||||||
|
if dist == 'ubuntu' or dist == 'debian':
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
|
||||||
def check_tools():
|
def check_tools():
|
||||||
required_tools = ["gcc", "g++", "xorriso", "make", "mtools", "curl"]
|
required_tools = ["gcc", "g++", "xorriso", "make", "mtools", "curl"]
|
||||||
missing_tools = []
|
missing_tools = []
|
||||||
@ -102,7 +114,9 @@ def check_tools():
|
|||||||
missing_tools.append(tool)
|
missing_tools.append(tool)
|
||||||
|
|
||||||
if len(missing_tools) > 0:
|
if len(missing_tools) > 0:
|
||||||
subprocess.run(["sudo", "apt", "install"] + missing_tools)
|
if check_os():
|
||||||
|
subprocess.run(["sudo", "apt", "install"] + missing_tools)
|
||||||
|
return
|
||||||
subprocess.run(["sudo", "pacman", "-S"] + missing_tools)
|
subprocess.run(["sudo", "pacman", "-S"] + missing_tools)
|
||||||
|
|
||||||
|
|
||||||
@ -165,4 +179,4 @@ if __name__ == "__main__":
|
|||||||
create_iso("bmosp")
|
create_iso("bmosp")
|
||||||
create_hdd("bmosp")
|
create_hdd("bmosp")
|
||||||
|
|
||||||
print(f"Не забудьте сохранить изменения! Номер сборки: {major}.{minor}.{build}")
|
print(f"Не забудьте сохранить изменения! Номер сборки: {major}.{minor}.{build}")
|
||||||
|
Loading…
Reference in New Issue
Block a user