]> git.ipfire.org Git - pakfire.git/commitdiff
dist: Make read_makefile private
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 21 Jun 2021 16:11:47 +0000 (16:11 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 21 Jun 2021 16:11:47 +0000 (16:11 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/pakfire.c
src/libpakfire/dist.c
src/libpakfire/include/pakfire/dist.h
src/libpakfire/include/pakfire/pakfire.h
src/libpakfire/libpakfire.sym

index 285ca62c3791a3f1c2f4c28c0b6315ecc405d994..5fe2a043932b1b71517f992b42c57dec932ae70b 100644 (file)
@@ -826,43 +826,6 @@ static PyObject* Pakfire_execute_script(PakfireObject* self, PyObject* args, PyO
        Py_RETURN_NONE;
 }
 
-static PyObject* Pakfire_read_makefile(PakfireObject* self, PyObject* args) {
-       const char* path = NULL;
-
-       if (!PyArg_ParseTuple(args, "s", &path))
-               return NULL;
-
-       PakfireParser parser = NULL;
-       struct pakfire_parser_error* error = NULL;
-
-       int r = pakfire_read_makefile(&parser, self->pakfire, path, &error);
-
-       // The parser could not parse the makefile
-       if (r == 1) {
-               PyErr_SetString(PyExc_SyntaxError, pakfire_parser_error_get_message(error));
-               PyErr_SyntaxLocation(
-                       pakfire_parser_error_get_filename(error),
-                       pakfire_parser_error_get_line(error)
-               );
-               return NULL;
-
-       // Handle any other internal error
-       } else if (r < 0) {
-               PyErr_SetFromErrno(PyExc_OSError);
-               return NULL;
-       }
-
-       PyObject* ret = new_parser(parser);
-       if (!ret)
-               return NULL;
-
-       pakfire_parser_unref(parser);
-       if (error)
-               pakfire_parser_error_unref(error);
-
-       return ret;
-}
-
 static PyObject* Pakfire_dist(PakfireObject* self, PyObject* args) {
        const char* path = NULL;
        const char* target = NULL;
@@ -1153,12 +1116,6 @@ static struct PyMethodDef Pakfire_methods[] = {
                METH_VARARGS|METH_KEYWORDS,
                NULL,
        },
-       {
-               "read_makefile",
-               (PyCFunction)Pakfire_read_makefile,
-               METH_VARARGS,
-               NULL
-       },
        {
                "refresh",
                (PyCFunction)Pakfire_refresh,
index cbb62fa998688043963752c4056950a5c7295352..80d9e795647cf808b4a6a8d10f90abcece21657c 100644 (file)
@@ -125,7 +125,7 @@ static int pakfire_makefile_set_defaults(Pakfire pakfire,
        return 0;
 }
 
-PAKFIRE_EXPORT int pakfire_read_makefile(PakfireParser* parser, Pakfire pakfire,
+int pakfire_read_makefile(PakfireParser* parser, Pakfire pakfire,
                const char* path, struct pakfire_parser_error** error) {
        int r = 1;
 
index c0582ac0039a0e1820faff5e3deb0f065695418b..431659cc15872b316e7b3f343ce2fcc24e927153 100644 (file)
 
 int pakfire_dist(Pakfire pakfire, const char* path, const char* target);
 
+#ifdef PAKFIRE_PRIVATE
+
+#include <pakfire/parser.h>
+
+int pakfire_read_makefile(PakfireParser* parser, Pakfire pakfire,
+       const char* path, struct pakfire_parser_error** error);
+
+#endif
+
 #endif /* PAKFIRE_DIST_H */
index f8adba0657a103745955d336db5bef77ddf55ad0..08900db40073af226edb708a481b70801733505a 100644 (file)
@@ -75,11 +75,6 @@ PakfirePackageList pakfire_search(Pakfire pakfire, const char* what, int flags);
 int pakfire_log_get_priority(Pakfire pakfire);
 void pakfire_log_set_priority(Pakfire pakfire, int priority);
 
-// Build
-
-int pakfire_read_makefile(PakfireParser* parser, Pakfire pakfire, const char* path,
-       struct pakfire_parser_error** error);
-
 // Install/Erase/Update
 
 int pakfire_install(Pakfire pakfire, const char** packages, int flags, int* changed);
index 3f090022d9dc82819a9ab176e3aba38e3e9f339e..d2db6a5fba9ef0bcb3bd03eef330ed03727c9dff 100644 (file)
@@ -39,7 +39,6 @@ global:
        pakfire_get_repo;
        pakfire_get_repos;
        pakfire_install;
-       pakfire_read_makefile;
        pakfire_ref;
        pakfire_refresh;
        pakfire_search;