Add: Start govel build packages
This commit is contained in:
parent
865ec5def5
commit
c26fcdc1db
18 changed files with 37 additions and 26 deletions
|
|
@ -7,18 +7,30 @@
|
|||
# Libre comme l’air, stable comme un menhir, et salé comme le beurre.
|
||||
#
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
from erminig.system.security import check_root, check_user_exists, run_as_user
|
||||
from erminig.core.config import Config
|
||||
from erminig.core.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):
|
||||
def run_build_function(pakva_path, name, version):
|
||||
"""
|
||||
Exécute la fonction build() du fichier Pakva donné.
|
||||
"""
|
||||
build_root = Config.BUILD_DIR / f"{name}-{version}"
|
||||
src_dir = build_root / "src"
|
||||
tmp_dir = build_root / "tmp"
|
||||
|
||||
os.makedirs(src_dir, exist_ok=True)
|
||||
os.makedirs(tmp_dir, exist_ok=True)
|
||||
|
||||
env = os.environ.copy()
|
||||
env["SRC"] = str(src_dir)
|
||||
env["TMP"] = str(tmp_dir)
|
||||
try:
|
||||
result = subprocess.run(
|
||||
f"""
|
||||
|
|
@ -32,6 +44,7 @@ def run_build_function(pakva_path):
|
|||
stderr=subprocess.PIPE,
|
||||
executable="/bin/bash",
|
||||
text=True,
|
||||
env=env,
|
||||
)
|
||||
print(f"[BUILD] Succès : {pakva_path.name}")
|
||||
print(result.stdout)
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
#
|
||||
|
||||
from pathlib import Path
|
||||
from erminig.config import Config
|
||||
from erminig.system.security import run_as_user
|
||||
from erminig.core.config import Config
|
||||
from erminig.core.security import run_as_user
|
||||
|
||||
|
||||
class Pakva:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue