From 01d961f68e0e4700e4a85597384361534234a9fc Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Thu, 20 Jan 2022 17:45:04 +0100 Subject: [PATCH] File stats are now correctly copied over to archive --- src/archive.v | 2 +- src/repo.v | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/archive.v b/src/archive.v index 7ded6a1..bdc1846 100644 --- a/src/archive.v +++ b/src/archive.v @@ -92,7 +92,7 @@ fn C.archive_entry_set_perm(&C.archive_entry, int) fn C.archive_entry_clear(&C.archive_entry) // Copy over a stat struct to the archive entry -fn C.archive_entry_copy_stat(&C.archive_entry, &C.stat) +fn C.archive_entry_copy_stat(entry &C.archive_entry, const_stat &C.stat) #include diff --git a/src/repo.v b/src/repo.v index ff84909..6ddde2a 100644 --- a/src/repo.v +++ b/src/repo.v @@ -119,10 +119,10 @@ fn (r &Repo) sync() ? { } C.archive_entry_set_pathname(entry, &char(inner_path.str)) - // C.archive_entry_copy_stat(entry, &st) - C.archive_entry_set_size(entry, st.st_size) - C.archive_entry_set_filetype(entry, C.AE_IFREG) - C.archive_entry_set_perm(entry, 0o644) + C.archive_entry_copy_stat(entry, &st) + // C.archive_entry_set_size(entry, st.st_size) + // C.archive_entry_set_filetype(entry, C.AE_IFREG) + // C.archive_entry_set_perm(entry, 0o644) C.archive_write_header(a, entry) fd := C.open(&char(actual_path.str), C.O_RDONLY)