Les choses sérieuses commencent
This commit is contained in:
parent
7a9fe18463
commit
c63f62721b
41 changed files with 1270 additions and 0 deletions
33
erminig/controllers/govel/build.py
Normal file
33
erminig/controllers/govel/build.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import subprocess
|
||||
from erminig.system.security import check_root, check_user_exists, run_as_user
|
||||
|
||||
check_root
|
||||
check_user_exists("pak")
|
||||
|
||||
|
||||
@run_as_user("pak")
|
||||
def run_build_function(pakva_path):
|
||||
"""
|
||||
Exécute la fonction build() du fichier Pakva donné.
|
||||
"""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
f"""
|
||||
set -e
|
||||
source "{pakva_path}"
|
||||
build
|
||||
""",
|
||||
shell=True,
|
||||
check=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
executable="/bin/bash",
|
||||
text=True,
|
||||
)
|
||||
print(f"[BUILD] Succès : {pakva_path.name}")
|
||||
print(result.stdout)
|
||||
return True
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"[BUILD] Échec : {pakva_path.name}")
|
||||
print(e.stderr)
|
||||
return False
|
||||
Loading…
Add table
Add a link
Reference in a new issue