From 6899dbfb472e9f8a8d19ce026c5ff1a713ecd902 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 25 Jun 2019 07:11:02 +0200 Subject: [PATCH] src/bin/proxmox-backup-client.rs: strip .blob extension --- src/bin/proxmox-backup-client.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index 167c7f2c..eb10b65c 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -168,7 +168,7 @@ fn backup_image>( Ok(()) } -fn strip_chunked_file_expenstions(list: Vec) -> Vec { +fn strip_server_file_expenstions(list: Vec) -> Vec { let mut result = vec![]; @@ -177,6 +177,8 @@ fn strip_chunked_file_expenstions(list: Vec) -> Vec { result.push(file[..file.len()-5].to_owned()); } else if file.ends_with(".fidx") { result.push(file[..file.len()-5].to_owned()); + } else if file.ends_with(".blob") { + result.push(file[..file.len()-5].to_owned()); } else { result.push(file); // should not happen } @@ -215,7 +217,7 @@ fn list_backups( let backup_dir = BackupDir::new(btype, id, epoch); let files = item["files"].as_array().unwrap().iter().map(|v| v.as_str().unwrap().to_owned()).collect(); - let files = strip_chunked_file_expenstions(files); + let files = strip_server_file_expenstions(files); for filename in files { let path = backup_dir.relative_path().to_str().unwrap().to_owned(); @@ -275,7 +277,7 @@ fn list_backup_groups( let path = group.group_path().to_str().unwrap().to_owned(); let files = item["files"].as_array().unwrap().iter().map(|v| v.as_str().unwrap().to_owned()).collect(); - let files = strip_chunked_file_expenstions(files); + let files = strip_server_file_expenstions(files); println!("{:20} | {} | {:5} | {}", path, last_backup.format("%c"), backup_count, tools::join(&files, ' ')); @@ -322,7 +324,7 @@ fn list_snapshots( let path = snapshot.relative_path().to_str().unwrap().to_owned(); let files = item["files"].as_array().unwrap().iter().map(|v| v.as_str().unwrap().to_owned()).collect(); - let files = strip_chunked_file_expenstions(files); + let files = strip_server_file_expenstions(files); println!("{} | {} | {}", path, snapshot.backup_time().format("%c"), tools::join(&files, ' ')); } @@ -794,7 +796,7 @@ fn complete_archive_name(_arg: &str, param: &HashMap) -> Vec) -> Vec {