]> git.ipfire.org Git - people/ric9/pakfire.git/commitdiff
stripper: Create directories where we are creating the files
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 8 Jan 2025 15:08:00 +0000 (15:08 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 8 Jan 2025 15:08:00 +0000 (15:08 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/stripper.c

index 794145e48e247c4ca8cca0538b82d5d07e92beec..99358a3777fee67f258e5e37c48b775a9ddbafd6 100644 (file)
@@ -346,6 +346,11 @@ static int pakfire_stripper_extract_debuginfo(struct pakfire_stripper* self,
                NULL,
        };
 
+       // Create the directories
+       r = pakfire_mkparentdir(build_id_path, 0755);
+       if (r < 0)
+               return r;
+
        // Run the command
        r = pakfire_jail_exec_command(self->jail, argv, NULL, 0);
        if (r < 0) {
@@ -417,11 +422,6 @@ static int pakfire_stripper_strip_debuginfo(struct pakfire_stripper* self,
 
        // Extract the debug information
        if (extract_debuginfo) {
-               // Create the directories
-               r = pakfire_mkparentdir(build_id_path, 0755);
-               if (r < 0)
-                       goto ERROR;
-
                r = pakfire_stripper_extract_debuginfo(self, file, elf, build_id_path);
                if (r < 0)
                        goto ERROR;