[pbs-devel] [PATCH proxmox v2] sys: pass create options as reference

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed May 29 12:22:51 CEST 2024


> Dietmar Maurer <dietmar at proxmox.com> hat am 29.05.2024 11:55 CEST geschrieben:
> 
>  
> Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
> ---
> 
> Changes in v2: change everywhere, so "cargo build --all --all-features" works again

what about proxmox-backup (and potentially other crates using it)?

I guess we could make a note for the next proxmox-sys bump we do for other reasons, but bumping half the world just for this seems a lot of work for little gain?

> 
>  proxmox-acme-api/src/account_config.rs        |  2 +-
>  proxmox-acme-api/src/config.rs                |  2 +-
>  proxmox-openid/src/auth_state.rs              |  4 ++--
>  .../src/filesystem_helpers.rs                 | 10 +++++-----
>  proxmox-rest-server/src/api_config.rs         |  4 ++--
>  proxmox-rest-server/src/daemon.rs             |  2 +-
>  proxmox-rest-server/src/file_logger.rs        |  2 +-
>  proxmox-rest-server/src/lib.rs                |  2 +-
>  proxmox-rest-server/src/worker_task.rs        | 10 +++++-----
>  proxmox-rrd/src/cache.rs                      |  4 ++--
>  proxmox-rrd/src/cache/journal.rs              |  4 ++--
>  proxmox-rrd/src/cache/rrd_map.rs              |  4 ++--
>  proxmox-rrd/src/rrd.rs                        |  2 +-
>  proxmox-subscription/src/files.rs             |  4 ++--
>  proxmox-sys/src/fs/dir.rs                     | 20 +++++++++----------
>  proxmox-sys/src/fs/file.rs                    |  8 ++++----
>  proxmox-sys/src/logrotate.rs                  |  2 +-
>  .../src/dns/resolv_conf.rs                    |  2 +-
>  18 files changed, 44 insertions(+), 44 deletions(-)
> 

[..]

> diff --git a/proxmox-subscription/src/files.rs b/proxmox-subscription/src/files.rs
> index 37008f4a..f0ff9bf4 100644
> --- a/proxmox-subscription/src/files.rs
> +++ b/proxmox-subscription/src/files.rs
> @@ -127,7 +127,7 @@ pub fn write_subscription<P: AsRef<Path>>(
>          format!("{}\n{}\n{}\n", info.key.as_ref().unwrap(), csum, encoded)
>      };
>  
> -    replace_file(path, raw.as_bytes(), file_opts, true)?;
> +    replace_file(path, raw.as_bytes(), &file_opts, true)?;
>  
>      Ok(())
>  }
> @@ -152,7 +152,7 @@ pub fn update_apt_auth<P: AsRef<Path>>(

this at least itself takes it as non-ref, shouldn't that be updated as well then?

>              let conf = format!("machine {url}\n login {}\n password {}\n", key, password,);
>  
>              // we use a namespaced .conf file, so just overwrite..
> -            replace_file(path, conf.as_bytes(), file_opts, true)
> +            replace_file(path, conf.as_bytes(), &file_opts, true)
>                  .map_err(|e| format_err!("Error saving apt auth config - {}", e))?;
>          }
>          _ => match std::fs::remove_file(path) {




More information about the pbs-devel mailing list