From 67d90b8d94b97cd2554bcfb49ea6f4309dd77675 Mon Sep 17 00:00:00 2001 From: Aren Elchinyan Date: Sun, 22 Oct 2023 15:27:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pbuild.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pbuild.py b/pbuild.py index 14c3fe5..89a9c63 100644 --- a/pbuild.py +++ b/pbuild.py @@ -2,6 +2,7 @@ import shutil import subprocess import time +import platform from multiprocessing import Pool @@ -93,6 +94,17 @@ def check_limine(): 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(): required_tools = ["gcc", "g++", "xorriso", "make", "mtools", "curl"] missing_tools = [] @@ -102,7 +114,9 @@ def check_tools(): missing_tools.append(tool) 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) @@ -165,4 +179,4 @@ def create_iso(IMAGE_NAME): create_iso("bmosp") create_hdd("bmosp") - print(f"Не забудьте сохранить изменения! Номер сборки: {major}.{minor}.{build}") \ No newline at end of file + print(f"Не забудьте сохранить изменения! Номер сборки: {major}.{minor}.{build}")