]> git.ipfire.org Git - pakfire.git/commitdiff
build: Fix adding Python ABI dependencies
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 14 Feb 2025 17:40:50 +0000 (17:40 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 14 Feb 2025 17:40:50 +0000 (17:40 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/build.c

index eafc86ee81f2862530273771e659fa0cfd3b1734..23fa05e9cce5d2028b7723c7bf7b29e1431648da 100644 (file)
@@ -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(