]> git.ipfire.org Git - pakfire.git/commitdiff
build: Skip requires which are provided by the same package
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Dec 2022 17:48:08 +0000 (17:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Dec 2022 17:48:08 +0000 (17:48 +0000)
This will avoid that the dependency resolution has to deal with
dependencies which should not really exist.

Fixes: #13000
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/build.c

index 6af8bacdd910825a303f855595ed581b8d59b263..10b3422cc975cdb5b30487ad9bf93565a6f4b4b0 100644 (file)
@@ -296,6 +296,18 @@ static int pakfire_build_process_deps(struct pakfire* pakfire,
        switch (priority) {
                // Add every dependency that we have received
                case LOG_INFO:
+                       // Filter out any dependencies that are provided by this package
+                       if (ctx->dep == PAKFIRE_PKG_REQUIRES) {
+                               r = pakfire_package_matches_dep(ctx->pkg, PAKFIRE_PKG_PROVIDES, buffer);
+                               if (r > 0) {
+                                       ERROR(pakfire,
+                                               "Skipping dependency that is provided by the package itself: %s\n",
+                                               buffer);
+                                       return 0;
+                               }
+                       }
+
+                       // Add dependency
                        r = pakfire_package_add_dep(ctx->pkg, ctx->dep, buffer);
                        if (r) {
                                ERROR(pakfire, "Could not process dependency '%s': %m\n", buffer);