]> git.ipfire.org Git - pakfire.git/commitdiff
build: Drop pakfire_build legacy function
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 28 Apr 2023 14:18:04 +0000 (14:18 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 28 Apr 2023 14:18:04 +0000 (14:18 +0000)
Since we need to extend the interface, it is becoming painful to keep
the compat layer working for only one call.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/pakfire.c
src/libpakfire/build.c
src/libpakfire/include/pakfire/build.h
src/libpakfire/libpakfire.sym

index 92cd5842f89bff7007ed7f70acbe3bccab6dfcd0..b6dfa3a762025e6be9ae4b36cceed26d8b32afc9 100644 (file)
@@ -1220,6 +1220,7 @@ static PyObject* Pakfire_build(PakfireObject* self, PyObject* args, PyObject* kw
                "disable_tests",
                NULL,
        };
+       struct pakfire_build* build = NULL;
        const char* path = NULL;
        const char* target = NULL;
        const char* build_id = NULL;
@@ -1252,8 +1253,24 @@ static PyObject* Pakfire_build(PakfireObject* self, PyObject* args, PyObject* kw
 
        Py_BEGIN_ALLOW_THREADS
 
+       // Create a new build environment
+       r = pakfire_build_create(&build, self->pakfire, build_id, flags);
+       if (r)
+               goto ERROR;
+
+       // Set target
+       if (target) {
+               r = pakfire_build_set_target(build, target);
+               if (r)
+                       goto ERROR;
+       }
+
        // Run build
-       r = pakfire_build(self->pakfire, path, target, build_id, flags);
+       r = pakfire_build_exec(build, path);
+
+ERROR:
+       if (build)
+               pakfire_build_unref(build);
 
        Py_END_ALLOW_THREADS
 
index dfa50e7d94935860d966ea9a6a966363a63b23c4..22e76c6fc9e270f7c52bf44d0ad6f107d1191e7e 100644 (file)
@@ -2162,42 +2162,6 @@ ERROR:
        return r;
 }
 
-/*
-       Compatibility function to keep the legacy API.
-*/
-PAKFIRE_EXPORT int pakfire_build(struct pakfire* pakfire, const char* path,
-               const char* target, const char* id, int flags) {
-       struct pakfire_build* build = NULL;
-       int r;
-
-       // Check if path is set
-       if (!path) {
-               errno = EINVAL;
-               return 1;
-       }
-
-       // Create a new build environment
-       r = pakfire_build_create(&build, pakfire, id, flags);
-       if (r)
-               goto ERROR;
-
-       // Set target
-       if (target) {
-               r = pakfire_build_set_target(build, target);
-               if (r)
-                       goto ERROR;
-       }
-
-       // Run build
-       r = pakfire_build_exec(build, path);
-
-ERROR:
-       if (build)
-               pakfire_build_unref(build);
-
-       return r;
-}
-
 int pakfire_build_clean(struct pakfire* pakfire, int flags) {
        struct pakfire_repo* local = NULL;
        int r = 0;
index cef7cfcdd46946c83e7499126e0d7f4d50ec1d2b..56749e78bec66981783d83d1823c9c6b17411eb3 100644 (file)
@@ -42,8 +42,6 @@ int pakfire_build_set_target(struct pakfire_build* build, const char* target);
 
 int pakfire_build_exec(struct pakfire_build* build, const char* path);
 
-int pakfire_build(struct pakfire* pakfire, const char* path, const char* target,
-       const char* id, int flags);
 int pakfire_build_clean(struct pakfire* pakfire, int flags);
 
 int pakfire_shell(struct pakfire* pakfire, const char** packages, int flags);
index 091c4ee1cc0d29822200cdbe15aa3aa114a72ebd..a68edebb3082f1f4346ef0f8be9fde751e7f8375 100644 (file)
@@ -64,7 +64,6 @@ global:
        pakfire_archive_verify;
 
        # build
-       pakfire_build;
        pakfire_build_create;
        pakfire_build_exec;
        pakfire_build_ref;