refs #401 fix subprocess returncode problem in some functions and adds ogboot/client directoriy creation

ogboot_installer
Luis Gerardo Romero Garcia 2024-05-29 10:33:28 +02:00
parent e275dcb6a4
commit f9b4e3eee9
1 changed files with 9 additions and 8 deletions

View File

@ -365,6 +365,7 @@ def createDirs(INSTALL_TARGET):
if not os.path.exists(INSTALL_TARGET): if not os.path.exists(INSTALL_TARGET):
try: try:
os.makedirs(INSTALL_TARGET) os.makedirs(INSTALL_TARGET)
os.makedirs(os.path.join(INSTALL_TARGET, "client")) # Create INSTALL_TARGET/client directory
except OSError: except OSError:
errorAndLog("Error while creating directory paths!") errorAndLog("Error while creating directory paths!")
exit(1) exit(1)
@ -553,9 +554,9 @@ def servicesCompilation():
# Compilar OpenGnsys Client # Compilar OpenGnsys Client
echoAndLog(f"{servicesCompilation.__name__}(): Compiling OpenGnsys Admin 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"]) 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") echoAndLog(f"{servicesCompilation.__name__}(): error while compiling OpenGnsys Admin Client")
hayErrores = 1 hayErrores = 1
@ -567,8 +568,8 @@ def copyInterfaceAdm():
# Crear carpeta y copiar Interface # Crear carpeta y copiar Interface
echoAndLog(f"{copyInterfaceAdm.__name__}(): Copying Administration Interface Folder") echoAndLog(f"{copyInterfaceAdm.__name__}(): Copying Administration Interface Folder")
subprocess.run(["cp", "-ar", f"{WORKDIR}/ogboot/sources/interface", f"{INSTALL_TARGET}/client/interfaceAdm"]) cp_process = subprocess.run(["cp", "-ar", f"{WORKDIR}/ogboot/sources/interface", f"{INSTALL_TARGET}/client/interfaceAdm"])
if subprocess.returncode != 0: if cp_process.returncode != 0:
echoAndLog(f"{copyInterfaceAdm.__name__}(): error while copying Administration Interface Folder") echoAndLog(f"{copyInterfaceAdm.__name__}(): error while copying Administration Interface Folder")
hayErrores = 1 hayErrores = 1
@ -579,15 +580,15 @@ def copyClientFiles():
errstatus = 0 errstatus = 0
echoAndLog(f"{copyClientFiles.__name__}(): Copying OpenGnsys Client files.") echoAndLog(f"{copyClientFiles.__name__}(): Copying OpenGnsys Client files.")
subprocess.run(["cp", "-a", f"{WORKDIR}/ogboot/client/shared/*", f"{INSTALL_TARGET}/client"]) cp_process = subprocess.run(["cp", "-a", f"{WORKDIR}/ogboot/client/shared/*", f"{INSTALL_TARGET}/client"])
if subprocess.returncode != 0: if cp_process.returncode != 0:
errorAndLog(f"{copyClientFiles.__name__}(): error while copying client structure") errorAndLog(f"{copyClientFiles.__name__}(): error while copying client structure")
errstatus = 1 errstatus = 1
echoAndLog(f"{copyClientFiles.__name__}(): Copying OpenGnsys Cloning Engine files.") echoAndLog(f"{copyClientFiles.__name__}(): Copying OpenGnsys Cloning Engine files.")
subprocess.run(["mkdir", "-p", f"{INSTALL_TARGET}/client/lib/engine/bin"]) 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"]) cp_engine_process = subprocess.run(["cp", "-a", f"{WORKDIR}/ogboot/client/engine/*.lib*", f"{INSTALL_TARGET}/client/lib/engine/bin"])
if subprocess.returncode != 0: if cp_engine_process.returncode != 0:
errorAndLog(f"{copyClientFiles.__name__}(): error while copying engine files") errorAndLog(f"{copyClientFiles.__name__}(): error while copying engine files")
errstatus = 1 errstatus = 1