static PyObject* Pakfire_shell(PakfireObject* self, PyObject* args, PyObject* kwargs) {
char* kwlist[] = {
"install",
+ "disable_snapshot",
NULL,
};
char** packages = NULL;
+ int disable_snapshot = 0;
// Parse everything
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O&", kwlist, convert_packages, &packages))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O&p", kwlist,
+ convert_packages, &packages, &disable_snapshot))
return NULL;
- int r = pakfire_shell(self->pakfire, (const char**)packages);
+ int flags = 0;
+
+ if (disable_snapshot)
+ flags |= PAKFIRE_BUILD_DISABLE_SNAPSHOT;
+
+ int r = pakfire_shell(self->pakfire, (const char**)packages, flags);
return execute_return_value(r);
}
This is a convenience function that sets up a build environment and
then drops the user into an interactive shell.
*/
-PAKFIRE_EXPORT int pakfire_shell(struct pakfire* pakfire, const char** packages) {
+PAKFIRE_EXPORT int pakfire_shell(struct pakfire* pakfire, const char** packages, int flags) {
struct pakfire_build* build = NULL;
int r;
+ // Shells are always interactive
+ flags |= PAKFIRE_BUILD_INTERACTIVE;
+
// Create a new build environment
- r = pakfire_build_create(&build, pakfire, NULL, PAKFIRE_BUILD_INTERACTIVE);
+ r = pakfire_build_create(&build, pakfire, NULL, flags);
if (r) {
ERROR(pakfire, "Could not create build: %m\n");
goto ERROR;
const char* id, int flags);
int pakfire_build_clean(struct pakfire* pakfire, int flags);
-int pakfire_shell(struct pakfire* pakfire, const char** packages);
+int pakfire_shell(struct pakfire* pakfire, const char** packages, int flags);
#endif /* PAKFIRE_BUILD_H */