From: Michael Tremer Date: Fri, 14 Feb 2025 17:40:50 +0000 (+0000) Subject: build: Fix adding Python ABI dependencies X-Git-Tag: 0.9.30~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ad5d7204dd50006fa08b2ae67666febbb34abd1;p=pakfire.git build: Fix adding Python ABI dependencies Signed-off-by: Michael Tremer --- 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(