[pbs-devel] [PATCH v3 proxmox-backup 25/58] restore: cover meta extension for pxar archives

Christian Ebner c.ebner at proxmox.com
Thu Mar 28 13:36:34 CET 2024


Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 2:
- use mpxar and ppxar file extensions
- merged with file restore patch into one

 pbs-client/src/tools/mod.rs      |  5 ++++-
 proxmox-file-restore/src/main.rs | 16 +++++++++++++---
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/pbs-client/src/tools/mod.rs b/pbs-client/src/tools/mod.rs
index 08986fc5e..f8d3102d1 100644
--- a/pbs-client/src/tools/mod.rs
+++ b/pbs-client/src/tools/mod.rs
@@ -337,7 +337,10 @@ pub fn complete_pxar_archive_name(arg: &str, param: &HashMap<String, String>) ->
     complete_server_file_name(arg, param)
         .iter()
         .filter_map(|name| {
-            if name.ends_with(".pxar.didx") || name.ends_with(".pxar.meta.didx") {
+            if name.ends_with(".pxar.didx")
+                || name.ends_with(".mpxar.didx")
+                || name.ends_with(".ppxar.didx")
+            {
                 Some(pbs_tools::format::strip_server_file_extension(name).to_owned())
             } else {
                 None
diff --git a/proxmox-file-restore/src/main.rs b/proxmox-file-restore/src/main.rs
index dbab69942..685ce34d9 100644
--- a/proxmox-file-restore/src/main.rs
+++ b/proxmox-file-restore/src/main.rs
@@ -75,7 +75,10 @@ fn parse_path(path: String, base64: bool) -> Result<ExtractPath, Error> {
         (file, path)
     };
 
-    if file.ends_with(".pxar.didx") {
+    if file.ends_with(".pxar.didx")
+        || file.ends_with(".mpxar.didx")
+        || file.ends_with(".ppxar.didx")
+    {
         Ok(ExtractPath::Pxar(file, path))
     } else if file.ends_with(".img.fidx") {
         Ok(ExtractPath::VM(file, path))
@@ -123,11 +126,18 @@ async fn list_files(
         ExtractPath::ListArchives => {
             let mut entries = vec![];
             for file in manifest.files() {
-                if !file.filename.ends_with(".pxar.didx") && !file.filename.ends_with(".img.fidx") {
+                if !file.filename.ends_with(".pxar.didx")
+                    && !file.filename.ends_with(".img.fidx")
+                    && !file.filename.ends_with(".mpxar.didx")
+                    && !file.filename.ends_with(".ppxar.didx")
+                {
                     continue;
                 }
                 let path = format!("/{}", file.filename);
-                let attr = if file.filename.ends_with(".pxar.didx") {
+                let attr = if file.filename.ends_with(".pxar.didx")
+                    || file.filename.ends_with(".mpxar.didx")
+                    || file.filename.ends_with(".ppxar.didx")
+                {
                     // a pxar file is a file archive, so it's root is also a directory root
                     Some(&DirEntryAttribute::Directory { start: 0 })
                 } else {
-- 
2.39.2





More information about the pbs-devel mailing list