From: Michael Tremer Date: Tue, 2 Mar 2021 21:52:53 +0000 (+0000) Subject: builder: Run build scripts in all stages X-Git-Tag: 0.9.28~1285^2~662 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8c215e87ed3a91f7e6904eec4dfdc3c87a10d01;p=pakfire.git builder: Run build scripts in all stages Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/builder.py b/src/pakfire/builder.py index f5a79533e..27ac7d341 100644 --- a/src/pakfire/builder.py +++ b/src/pakfire/builder.py @@ -62,6 +62,13 @@ BUILD_LOG_HEADER = """ """ +BUILD_SCRIPT = """#!/bin/bash -xe + +%%{_%s} + +exit 0 +""" + class Builder(object): def __init__(self, arch=None, build_id=None, logfile=None, **kwargs): self.config = config.Config("general.conf", "builder.conf") @@ -350,6 +357,17 @@ class BuilderContext(object): print(makefile) + # Execute stages + for stage in ("prepare", "build", "test", "install"): + # Fetch build script + script = makefile.expand("build", BUILD_SCRIPT % stage) + if not script: + continue + + # Run it + self.pakfire.execute_script(script, + enable_network=False, interactive=False) + def shell(self, packages=[], install=None): archives = []