Преглед на файлове

fix(manifest): improve file copy handling in resource installation

Explicitly check for destination file existence and delete if present before
copying to ensure clean file operations. Changed copy flags from OVERWRITE
to ALL_METADATA to properly preserve file attributes during resource
installation in the manifest processing.
clanker преди 1 месец
родител
ревизия
48f3b1c564
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      src/lib/Manifest.vala

+ 4 - 1
src/lib/Manifest.vala

@@ -422,7 +422,10 @@ namespace Usm {
                     
                     // Don't copy an alternative format resource if it has the same path as the non-alternative resource
                     if(source_exists && !dry_run && (!is_alternative_format_resource  || !alternative_format_resource_path_conflicts)) {
-                        src.copy(dest, FileCopyFlags.OVERWRITE, null, (c, t) => callback(resource.key, resources_installed, resource_count, (float)c / (float)t));
+                        if(dest.query_exists()) {
+                            dest.delete();
+                        }
+                        src.copy(dest, FileCopyFlags.ALL_METADATA, null, (c, t) => callback(resource.key, resources_installed, resource_count, (float)c / (float)t));
                     }
                 }
                 else if(resource.value.file_type == Usm.ManifestFileType.DIRECTORY) {