From: Michael Tremer Date: Mon, 21 Jun 2021 16:11:47 +0000 (+0000) Subject: dist: Make read_makefile private X-Git-Tag: 0.9.28~1210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf338f9be5065d70823c86c14a17bc1f8fa8276f;p=pakfire.git dist: Make read_makefile private Signed-off-by: Michael Tremer --- diff --git a/src/_pakfire/pakfire.c b/src/_pakfire/pakfire.c index 285ca62c3..5fe2a0439 100644 --- a/src/_pakfire/pakfire.c +++ b/src/_pakfire/pakfire.c @@ -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, diff --git a/src/libpakfire/dist.c b/src/libpakfire/dist.c index cbb62fa99..80d9e7956 100644 --- a/src/libpakfire/dist.c +++ b/src/libpakfire/dist.c @@ -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; diff --git a/src/libpakfire/include/pakfire/dist.h b/src/libpakfire/include/pakfire/dist.h index c0582ac00..431659cc1 100644 --- a/src/libpakfire/include/pakfire/dist.h +++ b/src/libpakfire/include/pakfire/dist.h @@ -25,4 +25,13 @@ int pakfire_dist(Pakfire pakfire, const char* path, const char* target); +#ifdef PAKFIRE_PRIVATE + +#include + +int pakfire_read_makefile(PakfireParser* parser, Pakfire pakfire, + const char* path, struct pakfire_parser_error** error); + +#endif + #endif /* PAKFIRE_DIST_H */ diff --git a/src/libpakfire/include/pakfire/pakfire.h b/src/libpakfire/include/pakfire/pakfire.h index f8adba065..08900db40 100644 --- a/src/libpakfire/include/pakfire/pakfire.h +++ b/src/libpakfire/include/pakfire/pakfire.h @@ -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); diff --git a/src/libpakfire/libpakfire.sym b/src/libpakfire/libpakfire.sym index 3f090022d..d2db6a5fb 100644 --- a/src/libpakfire/libpakfire.sym +++ b/src/libpakfire/libpakfire.sym @@ -39,7 +39,6 @@ global: pakfire_get_repo; pakfire_get_repos; pakfire_install; - pakfire_read_makefile; pakfire_ref; pakfire_refresh; pakfire_search;