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

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Apr 4 11:02:36 CEST 2024


On March 28, 2024 1:36 pm, Christian Ebner wrote:
> 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")
> +            {

hit reply to soon on the previous patch - this hunk here should be
folded into that one ;)

>                  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
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 




More information about the pbs-devel mailing list