From: Filip Schauer <f.schauer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v5 4/5] pxar: Adopt FileType enum when adding a zip entry
Date: Mon, 27 Oct 2025 14:24:46 +0100 [thread overview]
Message-ID: <20251027132450.101103-5-f.schauer@proxmox.com> (raw)
In-Reply-To: <20251027132450.101103-1-f.schauer@proxmox.com>
Use a FileType enum instead of a boolean to specify whether a ZipEntry
is a directory or a regular file.
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
| 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--git a/pbs-client/src/pxar/extract.rs b/pbs-client/src/pxar/extract.rs
index c4d0085c..f8775aaf 100644
--- a/pbs-client/src/pxar/extract.rs
+++ b/pbs-client/src/pxar/extract.rs
@@ -26,7 +26,7 @@ use proxmox_log::{debug, error, info};
use proxmox_sys::c_result;
use proxmox_sys::fs::{create_path, CreateOptions};
-use proxmox_compression::zip::{ZipEncoder, ZipEntry};
+use proxmox_compression::zip::{FileType, ZipEncoder, ZipEntry};
use crate::pxar::dir_stack::PxarDirStack;
use crate::pxar::metadata;
@@ -1034,7 +1034,7 @@ where
path,
metadata.stat.mtime.secs,
metadata.stat.mode as u16,
- false,
+ FileType::Directory,
);
zip.add_entry::<FileContents<T>>(entry, None).await?;
}
@@ -1053,7 +1053,7 @@ where
path,
metadata.stat.mtime.secs,
metadata.stat.mode as u16,
- true,
+ FileType::Regular,
);
let contents = decoder.contents().await?;
zip.add_entry(entry, contents)
@@ -1072,7 +1072,7 @@ where
path,
metadata.stat.mtime.secs,
metadata.stat.mode as u16,
- true,
+ FileType::Regular,
);
let contents = decoder.contents().await?;
zip.add_entry(entry, contents)
@@ -1085,7 +1085,7 @@ where
path,
metadata.stat.mtime.secs,
metadata.stat.mode as u16,
- false,
+ FileType::Directory,
);
zip.add_entry::<FileContents<T>>(entry, None).await?;
}
--
2.47.3
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-10-27 13:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 13:24 [pbs-devel] [PATCH proxmox{, -backup} v5 0/5] fix #4995: include symlinks in zip file restore Filip Schauer
2025-10-27 13:24 ` [pbs-devel] [PATCH proxmox v5 1/5] compression: zip: add a FileType enum Filip Schauer
2025-10-27 13:24 ` [pbs-devel] [PATCH proxmox v5 2/5] compression: zip: add support for symlinks Filip Schauer
2025-10-27 13:24 ` [pbs-devel] [PATCH proxmox v5 3/5] compression: add tests for the ZipEncoder Filip Schauer
2025-10-27 13:24 ` Filip Schauer [this message]
2025-10-27 13:24 ` [pbs-devel] [PATCH proxmox-backup v5 5/5] fix #4995: pxar: Include symlinks in zip file creation Filip Schauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251027132450.101103-5-f.schauer@proxmox.com \
--to=f.schauer@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.