From: Michael Tremer Date: Fri, 16 Apr 2021 16:37:08 +0000 (+0000) Subject: _pakfire: Drop mount/umount helper functions X-Git-Tag: 0.9.28~1285^2~339 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5c8b3a52cc88279e344be49d303437b18ae1a4e;p=pakfire.git _pakfire: Drop mount/umount helper functions Signed-off-by: Michael Tremer --- diff --git a/src/_pakfire/_pakfiremodule.c b/src/_pakfire/_pakfiremodule.c index c179d6fc3..e65d53c44 100644 --- a/src/_pakfire/_pakfiremodule.c +++ b/src/_pakfire/_pakfiremodule.c @@ -22,7 +22,6 @@ #include #include -#include #include @@ -67,56 +66,10 @@ static PyObject* _pakfire_arch_supported_by_host(PyObject* self, PyObject* args) Py_RETURN_FALSE; } -static PyObject* _pakfire_mount(PyObject* self, PyObject* args, PyObject* kwds) { - char* kwlist[] = { - "path", - "target", - "type", - "flags", - "options", - NULL, - }; - - const char* path = NULL; - const char* target = NULL; - const char* type = NULL; - int flags = 0; - const char* options = NULL; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "ss|zis", kwlist, - &path, &target, &type, &flags, &options)) - return NULL; - - int r = mount(path, target, type, flags, options); - if (r) { - PyErr_SetFromErrnoWithFilename(PyExc_OSError, path); - return NULL; - } - - Py_RETURN_NONE; -} - -static PyObject* _pakfire_umount(PyObject* self, PyObject* args) { - const char* path = NULL; - - if (!PyArg_ParseTuple(args, "s", &path)) - return NULL; - - int r = umount(path); - if (r) { - PyErr_SetFromErrnoWithFilename(PyExc_OSError, path); - return NULL; - } - - Py_RETURN_NONE; -} - static PyMethodDef pakfireModuleMethods[] = { {"performance_index", (PyCFunction)performance_index, METH_VARARGS, NULL}, {"native_arch", (PyCFunction)_pakfire_native_arch, METH_NOARGS, NULL }, {"arch_supported_by_host", (PyCFunction)_pakfire_arch_supported_by_host, METH_VARARGS, NULL }, - {"mount", (PyCFunction)_pakfire_mount, METH_VARARGS|METH_KEYWORDS, NULL }, - {"umount", (PyCFunction)_pakfire_umount, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; @@ -261,30 +214,5 @@ PyMODINIT_FUNC PyInit__pakfire(void) { if (PyModule_AddIntConstant(module, "PAKFIRE_EQ", PAKFIRE_EQ)) return NULL; - // Mount Flags - if (PyModule_AddIntConstant(module, "MS_NOATIME", MS_NOATIME)) - return NULL; - - if (PyModule_AddIntConstant(module, "MS_NODEV", MS_NODEV)) - return NULL; - - if (PyModule_AddIntConstant(module, "MS_NOEXEC", MS_NOEXEC)) - return NULL; - - if (PyModule_AddIntConstant(module, "MS_RDONLY", MS_RDONLY)) - return NULL; - - if (PyModule_AddIntConstant(module, "MS_RELATIME", MS_RELATIME)) - return NULL; - - if (PyModule_AddIntConstant(module, "MS_STRICTATIME", MS_STRICTATIME)) - return NULL; - - if (PyModule_AddIntConstant(module, "MS_BIND", MS_BIND)) - return NULL; - - if (PyModule_AddIntConstant(module, "MS_REMOUNT", MS_REMOUNT)) - return NULL; - return module; }