]> git.ipfire.org Git - pakfire.git/commitdiff
stripper: Only strip files that are not stripped, yet
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Jan 2025 17:08:30 +0000 (17:08 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Jan 2025 17:08:30 +0000 (17:08 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/stripper.c

index 9d851d832b5d75b058e35a1a44a12aae3fcaee40..eaa9c3b0f41f0485a1924f7cfa8843f2b3e9852c 100644 (file)
@@ -505,15 +505,18 @@ static int pakfire_stripper_strip(
        if (r < 0)
                goto ERROR;
 
-       // Copy sources
-       r = pakfire_stripper_copy_sources(stripper, file, fd);
-       if (r < 0)
-               goto ERROR;
+       // Only strip if there is actually some debug information
+       if (!pakfire_elf_is_stripped(elf)) {
+               // Copy sources
+               r = pakfire_stripper_copy_sources(stripper, file, fd);
+               if (r < 0)
+                       goto ERROR;
 
-       // Strip debug information
-       r = pakfire_stripper_strip_debug_sections(stripper, file, elf);
-       if (r < 0)
-               goto ERROR;
+               // Strip debug information
+               r = pakfire_stripper_strip_debug_sections(stripper, file, elf);
+               if (r < 0)
+                       goto ERROR;
+       }
 
 ERROR:
        if (elf)