public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Markus Frank <m.frank@proxmox.com>
Cc: pbs-devel@lists.proxmox.com
Subject: Re: [pbs-devel] [PATCH proxmox-backup v2 3/3] proxmox-backup-client: added ignore-acl/xattr/ownership/permission & overwrite parameters
Date: Thu, 18 Aug 2022 14:03:12 +0200	[thread overview]
Message-ID: <20220818120312.36ixxdwygqpt7tkc@casey.proxmox.com> (raw)
In-Reply-To: <20220818110654.56988-4-m.frank@proxmox.com>

Sorry for missing this in the v1 revie, but I think it's better to have
the parameters as actual function paramters, and the api description
contain the `default` values.

Also, I think most of these should use plural form ;-)

On Thu, Aug 18, 2022 at 01:06:54PM +0200, Markus Frank wrote:
> If ignore-acl/ignore-xattr/ignore-ownership/ignore-permission is set,
> the corresponding flag gets removed.
> 
> overwrite-existing-files is saved as an PxarExtractOption like
> allow-existing-dirs.
> 
> Signed-off-by: Markus Frank <m.frank@proxmox.com>
> ---
> v2: added ignore-permission
> 
>  proxmox-backup-client/src/main.rs | 49 ++++++++++++++++++++++++++++++-
>  1 file changed, 48 insertions(+), 1 deletion(-)
> 
> diff --git a/proxmox-backup-client/src/main.rs b/proxmox-backup-client/src/main.rs
> index 4bb9aa5e..dc038864 100644
> --- a/proxmox-backup-client/src/main.rs
> +++ b/proxmox-backup-client/src/main.rs
> @@ -1201,6 +1201,31 @@ We do not extract '.pxar' archives when writing to standard output.
>                  type: CryptMode,
>                  optional: true,
>              },
> +            "ignore-acl": {

acl -> acls

> +                type: Boolean,
> +                description: "ignore acl settings",
> +                optional: true,

Add `default: false,`

> +            },
> +            "ignore-xattr": {

xattr -> xattrs

> +                type: Boolean,
> +                description: "ignore xattr settings",
> +                optional: true,

Add `default: false,`

> +            },
> +            "ignore-ownership": {
> +                type: Boolean,
> +                description: "ignore owner settings (no chown)",
> +                optional: true,

Add `default: false,`

> +            },
> +            "ignore-permission": {

permission -> permissions

> +                type: Boolean,
> +                description: "ignore permission settings (no chmod)",
> +                optional: true,

Add `default: false,`

> +            },
> +            "overwrite-existing-files": {

I think 'overwrite' could be enough actually.
(eg. tar has `--overwrite`)

> +                type: Boolean,
> +                description: "overwrite already existing files",
> +                optional: true,
> +            },
>          }
>      }
>  )]
> @@ -1210,6 +1235,12 @@ async fn restore(param: Value) -> Result<Value, Error> {

^ You can just place `bool` parameters in the `fn()` signature and
they'll be filled with the `default` values automatically by the api
macro (just use underscores in place of the minuses).
The `param: Value` parameter will then only contain the remaining
arguments.

(Most of the required parameters could actually be changed this way, but
not necessarily in the same patch series...)

>  
>      let allow_existing_dirs = param["allow-existing-dirs"].as_bool().unwrap_or(false);
>  
> +    let ignore_acls = param["ignore-acl"].as_bool().unwrap_or(false);
> +    let ignore_xattr = param["ignore-xattr"].as_bool().unwrap_or(false);
> +    let ignore_ownership = param["ignore-ownership"].as_bool().unwrap_or(false);
> +    let ignore_permission = param["ignore-permission"].as_bool().unwrap_or(false);
> +    let overwrite_existing_files = param["overwrite-existing-files"].as_bool().unwrap_or(false);

^ then this entire block can be dropped




      reply	other threads:[~2022-08-18 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 11:06 [pbs-devel] [PATCH proxmox-backup v2 0/3] pbs-client: feature #3923 Markus Frank
2022-08-18 11:06 ` [pbs-devel] [PATCH proxmox-backup v2 1/3] pbs-client: added overwrite-existing-files to PxarExtractOptions Markus Frank
2022-08-18 11:06 ` [pbs-devel] [PATCH proxmox-backup v2 2/3] pbs-client: added options to skip xattr/acl/ownership/permissions Markus Frank
2022-08-18 11:06 ` [pbs-devel] [PATCH proxmox-backup v2 3/3] proxmox-backup-client: added ignore-acl/xattr/ownership/permission & overwrite parameters Markus Frank
2022-08-18 12:03   ` Wolfgang Bumiller [this message]

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=20220818120312.36ixxdwygqpt7tkc@casey.proxmox.com \
    --to=w.bumiller@proxmox.com \
    --cc=m.frank@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal