From 2d32fe2c046331a94ad9bc1a7875ed5e0de73c90 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 2 Jun 2020 18:41:32 +0200 Subject: [PATCH] client restore: don't add server file ending if already specified If one executes a client command like # proxmox-backup-client files --repository ... the files shown have already the '.fidx' or '.blob' file ending, so if a user would just copy paste that one the client would always add .blob, and the server would not find that file. So avoid adding file endings if it is already a known OK one. Signed-off-by: Thomas Lamprecht --- src/bin/proxmox-backup-client.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index 5ef2036b..53276b72 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -1108,7 +1108,9 @@ fn dump_image( } fn parse_archive_type(name: &str) -> (String, ArchiveType) { - if name.ends_with(".pxar") { + if name.ends_with(".didx") || name.ends_with(".fidx") || name.ends_with(".blob") { + (name.into(), archive_type(name).unwrap()) + } else if name.ends_with(".pxar") { (format!("{}.didx", name), ArchiveType::DynamicIndex) } else if name.ends_with(".img") { (format!("{}.fidx", name), ArchiveType::FixedIndex)