]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
_pakfire: Drop mount/umount helper functions
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 16 Apr 2021 16:37:08 +0000 (16:37 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 16 Apr 2021 16:37:08 +0000 (16:37 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/_pakfiremodule.c

index c179d6fc33c712a1fa11e371436749b8134b016d..e65d53c44efffccbb62d72731bd51f06b6a75174 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <libintl.h>
 #include <locale.h>
-#include <sys/mount.h>
 
 #include <solv/solver.h>
 
@@ -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;
 }