]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
pakfire-builder: Make it possible to run builds interactive and non-interactive
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 4 Nov 2022 15:03:01 +0000 (15:03 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 4 Nov 2022 15:14:39 +0000 (15:14 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/pakfire.c
src/scripts/pakfire-builder.in

index 3f9003a6a4d5f9ef83b24c787d395105101a7e8c..286678988b13e2dd156e932cb7ef77718aa2f0dd 100644 (file)
@@ -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;
index df2a551d6cdeafffe4bde5d19fe9213612fd86bb..2be89b1e3384c0a9b55780b304a5de0929c6959a 100644 (file)
@@ -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,