]> git.ipfire.org Git - pakfire.git/commitdiff
file: Don't try to resolve paths relative to Pakfire in stub mode
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 27 Mar 2025 18:07:57 +0000 (18:07 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 27 Mar 2025 18:07:57 +0000 (18:07 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/file.c

index 35e47af51e6460d12ea27d4c8613f9d6cccffa90..5323e0c56cdfa277437aab29cf045043d52da59f 100644 (file)
@@ -806,13 +806,16 @@ int pakfire_file_set_path(struct pakfire_file* file, const char* path) {
        // Store the path
        archive_entry_set_pathname(file->entry, buffer);
 
-       // Make the absolute path
-       r = pakfire_path(file->pakfire, buffer, "%s", buffer);
-       if (r < 0)
-               return r;
+       // Store the absolute path only when not in stub mode
+       if (!pakfire_has_flag(file->pakfire, PAKFIRE_FLAGS_STUB)) {
+               // Make the absolute path
+               r = pakfire_path(file->pakfire, buffer, "%s", buffer);
+               if (r < 0)
+                       return r;
 
-       // Store the abspath
-       archive_entry_copy_sourcepath(file->entry, buffer);
+               // Store the abspath
+               archive_entry_copy_sourcepath(file->entry, buffer);
+       }
 
        return 0;
 }