From 6ad5d7204dd50006fa08b2ae67666febbb34abd1 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 14 Feb 2025 17:40:50 +0000 Subject: [PATCH] build: Fix adding Python ABI dependencies Signed-off-by: Michael Tremer --- src/pakfire/build.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pakfire/build.c b/src/pakfire/build.c index eafc86ee..23fa05e9 100644 --- a/src/pakfire/build.c +++ b/src/pakfire/build.c @@ -562,6 +562,7 @@ ERROR: static int pakfire_build_find_python_abi_requires( struct pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) { char basename[PATH_MAX]; + const char* p = NULL; int r; // Fetch the path @@ -578,9 +579,15 @@ static int pakfire_build_find_python_abi_requires( if (!pakfire_string_startswith(basename, "python")) return -EINVAL; + // Skip "python" + p = basename + strlen("python"); + + // Terminate if this was the entire string + if (!*p) + return 0; + // Add the dependency - return pakfire_package_add_dep(deps->pkg, - PAKFIRE_PKG_REQUIRES, "python-abi = %s", basename + strlen("python")); + return pakfire_package_add_dep(deps->pkg, PAKFIRE_PKG_REQUIRES, "python-abi = %s", p); } static int pakfire_build_find_symlink_destinations( -- 2.39.5