]> git.ipfire.org Git - pakfire.git/commitdiff
stripper: Write the debug information directory the Build ID file
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 30 Dec 2024 15:33:34 +0000 (15:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 30 Dec 2024 15:33:34 +0000 (15:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/stripper.c

index 58abe1d3f131370cd0143102aeddbd2de6fec5a8..e135fb71e76fdd807f3fab975e2002a13e632ecb 100644 (file)
@@ -399,42 +399,21 @@ static int __pakfire_stripper_build_id_path(struct pakfire_stripper* stripper,
                buildroot, build_id[0], build_id[1], build_id + 2);
 }
 
-#define pakfire_stripper_debug_path(stripper, buffer, file) \
-       __pakfire_stripper_debug_path(stripper, buffer, sizeof(buffer), file)
-
-static int __pakfire_stripper_debug_path(struct pakfire_stripper* stripper,
-               char* buffer, size_t length, struct pakfire_file* file) {
-       const char* buildroot = pakfire_relpath(stripper->pakfire, stripper->path);
-
-       return __pakfire_path(stripper->pakfire, buffer, length,
-               "%s/usr/lib/debug%s.debug", buildroot, pakfire_file_get_path(file));
-}
-
 static int pakfire_stripper_extract_debug_sections(struct pakfire_stripper* stripper,
                struct pakfire_file* file, const char* build_id) {
        char build_id_path[PATH_MAX];
-       char debug_path[PATH_MAX];
        const char* path = NULL;
        int r;
 
        // Fetch the path
        path = pakfire_file_get_abspath(file);
 
-       // Make the debug path
-       r = pakfire_stripper_debug_path(stripper, debug_path, file);
-       if (r < 0)
-               return r;
-
        // Make Build ID path
        r = pakfire_stripper_build_id_path(stripper, build_id_path, build_id);
        if (r < 0)
                return r;
 
        // Create the directories
-       r = pakfire_mkparentdir(debug_path, 0755);
-       if (r < 0)
-               return r;
-
        r = pakfire_mkparentdir(build_id_path, 0755);
        if (r < 0)
                return r;
@@ -443,28 +422,24 @@ static int pakfire_stripper_extract_debug_sections(struct pakfire_stripper* stri
                "objcopy",
                "--only-keep-debug",
                pakfire_relpath(stripper->pakfire, path),
-               pakfire_relpath(stripper->pakfire, debug_path),
+               pakfire_relpath(stripper->pakfire, build_id_path),
                NULL,
        };
 
        // Run the command
        r = pakfire_jail_exec_command(stripper->jail, argv, NULL, 0);
        if (r < 0) {
-               ERROR(stripper->ctx, "Could not strip debug sections from %s: %s\n",
+               ERROR(stripper->ctx, "Could not extract debug sections from %s: %s\n",
                        pakfire_file_get_path(file), strerror(-r));
                return r;
 
        // The command returned an error
        } else if (r > 0) {
-               ERROR(stripper->ctx, "Could not strip debug sections from %s\n",
+               ERROR(stripper->ctx, "Could not extract debug sections from %s\n",
                        pakfire_file_get_path(file));
                return -ENOTSUP;
        }
 
-       // Create a symlink
-       r = pakfire_symlink(stripper->ctx, debug_path, build_id_path);
-       if (r < 0)
-               return r;
 
        return r;
 }