From f9b4e3eee972f8e56383fa39ed3ac3538de67b4d Mon Sep 17 00:00:00 2001 From: lgromero Date: Wed, 29 May 2024 10:33:28 +0200 Subject: [PATCH] refs #401 fix subprocess returncode problem in some functions and adds ogboot/client directoriy creation --- installer/ogboot_installer.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/installer/ogboot_installer.py b/installer/ogboot_installer.py index 810c694..92f41e6 100755 --- a/installer/ogboot_installer.py +++ b/installer/ogboot_installer.py @@ -365,6 +365,7 @@ def createDirs(INSTALL_TARGET): if not os.path.exists(INSTALL_TARGET): try: os.makedirs(INSTALL_TARGET) + os.makedirs(os.path.join(INSTALL_TARGET, "client")) # Create INSTALL_TARGET/client directory except OSError: errorAndLog("Error while creating directory paths!") exit(1) @@ -553,9 +554,9 @@ def servicesCompilation(): # Compilar OpenGnsys Client echoAndLog(f"{servicesCompilation.__name__}(): Compiling OpenGnsys Admin Client") - subprocess.run(["make"], cwd=f"{WORKDIR}/ogboot/sources/clients/ogAdmClient") + process = subprocess.run(["make"], cwd=f"{WORKDIR}/ogboot/sources/clients/ogAdmClient") subprocess.run(["mv", f"{WORKDIR}/ogboot/sources/clients/ogAdmClient/ogAdmClient", f"{WORKDIR}/ogboot/client/shared/bin"]) - if subprocess.returncode != 0: + if process.returncode != 0: echoAndLog(f"{servicesCompilation.__name__}(): error while compiling OpenGnsys Admin Client") hayErrores = 1 @@ -567,8 +568,8 @@ def copyInterfaceAdm(): # Crear carpeta y copiar Interface echoAndLog(f"{copyInterfaceAdm.__name__}(): Copying Administration Interface Folder") - subprocess.run(["cp", "-ar", f"{WORKDIR}/ogboot/sources/interface", f"{INSTALL_TARGET}/client/interfaceAdm"]) - if subprocess.returncode != 0: + cp_process = subprocess.run(["cp", "-ar", f"{WORKDIR}/ogboot/sources/interface", f"{INSTALL_TARGET}/client/interfaceAdm"]) + if cp_process.returncode != 0: echoAndLog(f"{copyInterfaceAdm.__name__}(): error while copying Administration Interface Folder") hayErrores = 1 @@ -579,15 +580,15 @@ def copyClientFiles(): errstatus = 0 echoAndLog(f"{copyClientFiles.__name__}(): Copying OpenGnsys Client files.") - subprocess.run(["cp", "-a", f"{WORKDIR}/ogboot/client/shared/*", f"{INSTALL_TARGET}/client"]) - if subprocess.returncode != 0: + cp_process = subprocess.run(["cp", "-a", f"{WORKDIR}/ogboot/client/shared/*", f"{INSTALL_TARGET}/client"]) + if cp_process.returncode != 0: errorAndLog(f"{copyClientFiles.__name__}(): error while copying client structure") errstatus = 1 echoAndLog(f"{copyClientFiles.__name__}(): Copying OpenGnsys Cloning Engine files.") subprocess.run(["mkdir", "-p", f"{INSTALL_TARGET}/client/lib/engine/bin"]) - subprocess.run(["cp", "-a", f"{WORKDIR}/ogboot/client/engine/*.lib*", f"{INSTALL_TARGET}/client/lib/engine/bin"]) - if subprocess.returncode != 0: + cp_engine_process = subprocess.run(["cp", "-a", f"{WORKDIR}/ogboot/client/engine/*.lib*", f"{INSTALL_TARGET}/client/lib/engine/bin"]) + if cp_engine_process.returncode != 0: errorAndLog(f"{copyClientFiles.__name__}(): error while copying engine files") errstatus = 1