From: Michael Tremer Date: Thu, 8 Dec 2022 17:48:08 +0000 (+0000) Subject: build: Skip requires which are provided by the same package X-Git-Tag: 0.9.28~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1173addc620f28f97c7a125398fc61686499320;p=pakfire.git build: Skip requires which are provided by the same package This will avoid that the dependency resolution has to deal with dependencies which should not really exist. Fixes: #13000 Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/build.c b/src/libpakfire/build.c index 6af8bacdd..10b3422cc 100644 --- a/src/libpakfire/build.c +++ b/src/libpakfire/build.c @@ -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);