}
static PyObject* Pakfire_build(PakfireObject* self, PyObject* args, PyObject* kwargs) {
- char* kwlist[] = { "path", "build_id", "logging_callback", "interactive", NULL };
+ char* kwlist[] = {
+ "path",
+ "build_id",
+ "logging_callback",
+ NULL,
+ };
const char* path = NULL;
const char* build_id = NULL;
PyObject* logging_callback = NULL;
- int interactive = 0;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|zOp", kwlist, &path,
- &build_id, &logging_callback, &interactive))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|zO", kwlist, &path,
+ &build_id, &logging_callback))
return NULL;
- int flags = 0;
-
- // Enable interactive mode
- if (interactive)
- flags |= PAKFIRE_BUILD_INTERACTIVE;
-
// Check if logging_callback is
if (logging_callback && !PyCallable_Check(logging_callback)) {
PyErr_SetString(PyExc_TypeError, "logging_callback must be callable\n");
Pakfire_execute_logging_callback = logging_callback;
// Run build
- int r = pakfire_build(self->pakfire, path, NULL, build_id, flags,
+ int r = pakfire_build(self->pakfire, path, NULL, build_id, 0,
(logging_callback) ? __Pakfire_execute_logging_callback : NULL, NULL);
return execute_return_value(r);
r = pakfire_build_stage(pakfire, makefile, *stage, logging_callback, data);
if (r) {
// Drop to a shell for debugging
- if (flags & PAKFIRE_BUILD_INTERACTIVE)
+ if (pakfire_has_flag(pakfire, PAKFIRE_FLAGS_INTERACTIVE))
pakfire_execute_shell(pakfire);
goto ERROR;
#include <pakfire/execute.h>
#include <pakfire/pakfire.h>
-enum pakfire_build_flags {
- PAKFIRE_BUILD_INTERACTIVE = (1 << 0),
-};
-
int pakfire_build(struct pakfire* pakfire, const char* path, const char* target,
const char* id, int flags, pakfire_execute_logging_callback logging_callback, void* data);
int pakfire_shell(struct pakfire* pakfire);
return args
- def pakfire(self, ns, build=True):
+ def pakfire(self, ns, build=True, interactive=True):
# Find distro configuration file
conf = os.path.join(CONFIG_DISTRO_DIR, "%s.conf" % ns.distro)
# Set up logging
logger=self.logger.log,
+ interactive=interactive,
# Enable build mode
build=build,
enable_snapshot=not ns.disable_snapshot,
-
)
def __call__(self):
try:
# Initialise a builder instance and build this package
- p = self.pakfire(ns)
+ p = self.pakfire(ns, interactive=ns.interactive)
# Package any makefiles
if package.endswith(".nm"):
p.build(
package,
build_id="%s" % ns.build_id if ns.build_id else None,
- interactive=ns.interactive,
)
# Cleanup the temporary directory