From 08ca63e943a759b0b732c23413c552ab7b312ecf Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 4 Nov 2022 15:03:01 +0000 Subject: [PATCH] pakfire-builder: Make it possible to run builds interactive and non-interactive Signed-off-by: Michael Tremer --- src/_pakfire/pakfire.c | 9 +++++++-- src/scripts/pakfire-builder.in | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/_pakfire/pakfire.c b/src/_pakfire/pakfire.c index 3f9003a6a..286678988 100644 --- a/src/_pakfire/pakfire.c +++ b/src/_pakfire/pakfire.c @@ -1114,6 +1114,7 @@ static PyObject* Pakfire_build(PakfireObject* self, PyObject* args, PyObject* kw "path", "target", "build_id", + "interactive", "disable_snapshot", "disable_ccache", "disable_tests", @@ -1123,16 +1124,20 @@ static PyObject* Pakfire_build(PakfireObject* self, PyObject* args, PyObject* kw const char* path = NULL; const char* target = NULL; const char* build_id = NULL; + int interactive = 0; int disable_snapshot = 0; int disable_ccache = 0; int disable_tests = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|zzppp", kwlist, &path, &target, - &build_id, &disable_snapshot, &disable_ccache, &disable_tests)) + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|zzpppp", kwlist, &path, &target, + &build_id, &interactive, &disable_snapshot, &disable_ccache, &disable_tests)) return NULL; int flags = 0; + if (interactive) + flags |= PAKFIRE_BUILD_INTERACTIVE; + // Disable snapshot if requested if (disable_snapshot) flags |= PAKFIRE_BUILD_DISABLE_SNAPSHOT; diff --git a/src/scripts/pakfire-builder.in b/src/scripts/pakfire-builder.in index df2a551d6..2be89b1e3 100644 --- a/src/scripts/pakfire-builder.in +++ b/src/scripts/pakfire-builder.in @@ -55,8 +55,8 @@ class Cli(object): help=_("Build ID")) build.add_argument("--resultdir", nargs="?", help=_("Path were the output files should be copied to")) - build.add_argument("--after-shell", action="store_true", - help=_("Run a shell after a successful build")) + build.add_argument("--non-interactive", action="store_true", + help=_("Disables running a shell in case the build fails")) build.add_argument("--skip-install-test", action="store_true", help=_("Do not perform the install test")) build.add_argument("--disable-ccache", action="store_true", @@ -203,6 +203,7 @@ class Cli(object): for package in packages: p.build( package, + interactive=not ns.non_interactive, build_id="%s" % ns.build_id if ns.build_id else None, disable_ccache=ns.disable_ccache, disable_snapshot=ns.disable_snapshot, -- 2.39.5