[pbs-devel] applied: [PATCH] update dependencies for proxmox and proxmox-backup

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Sep 28 09:13:00 CEST 2020


drop chrono depedency as proxmox-backup did

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 Cargo.toml    | 5 ++---
 src/backup.rs | 2 +-
 src/lib.rs    | 7 ++-----
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 0a3bc3c..043ae96 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,15 +17,14 @@ cbindgen = "0.14.2"
 [dependencies]
 anyhow = "1.0"
 bytes = "0.5"
-chrono = "0.4" # Date and time library for Rust
 futures = "0.3"
 h2 = { version = "0.2", features = ["stream"] }
 lazy_static = "1.4"
 libc = "0.2"
 once_cell = "1.3.1"
 openssl = "0.10"
-proxmox = { version = "0.3.5", features = [ "sortable-macro", "api-macro" ] }
-proxmox-backup = { git = "git://git.proxmox.com/git/proxmox-backup.git", tag = "v0.8.16" }
+proxmox = { version = "0.4.1", features = [ "sortable-macro", "api-macro" ] }
+proxmox-backup = { git = "git://git.proxmox.com/git/proxmox-backup.git", tag = "v0.8.21" }
 #proxmox-backup = { path = "../proxmox-backup" }
 serde_json = "1.0"
 tokio = { version = "0.2.9", features = [ "blocking", "fs", "io-util", "macros", "rt-threaded", "signal", "stream", "tcp", "time", "uds" ] }
diff --git a/src/backup.rs b/src/backup.rs
index aa65239..9f8a240 100644
--- a/src/backup.rs
+++ b/src/backup.rs
@@ -59,7 +59,7 @@ impl BackupTask {
 
         let (abort, _) = tokio::sync::broadcast::channel(16);
 
-        let snapshot = BackupDir::new(&setup.backup_type, &setup.backup_id, setup.backup_time.timestamp())?;
+        let snapshot = BackupDir::new(&setup.backup_type, &setup.backup_id, setup.backup_time)?;
         let manifest = Arc::new(Mutex::new(BackupManifest::new(snapshot)));
 
         let registry = Arc::new(Mutex::new(Registry::<ImageUploadInfo>::new()));
diff --git a/src/lib.rs b/src/lib.rs
index 67f2fe9..08cac4c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -10,7 +10,6 @@ use proxmox::try_block;
 use proxmox_backup::api2::types::Userid;
 use proxmox_backup::backup::{CryptMode, BackupDir};
 use proxmox_backup::client::BackupRepository;
-use chrono::{DateTime, Utc, TimeZone};
 
 mod capi_types;
 use capi_types::*;
@@ -120,7 +119,7 @@ pub(crate) struct BackupSetup {
     pub chunk_size: u64,
     pub backup_type: String,
     pub backup_id: String,
-    pub backup_time: DateTime<Utc>,
+    pub backup_time: i64,
     pub password: Option<String>,
     pub keyfile: Option<std::path::PathBuf>,
     pub key_password: Option<String>,
@@ -209,8 +208,6 @@ pub extern "C" fn proxmox_backup_new(
         let backup_id = tools::utf8_c_string(backup_id)?
             .ok_or_else(|| format_err!("backup_id must not be NULL"))?;
 
-        let backup_time = Utc.timestamp(backup_time as i64, 0);
-
         let password = tools::utf8_c_string(password)?;
         let keyfile = tools::utf8_c_string(keyfile)?.map(std::path::PathBuf::from);
         let key_password = tools::utf8_c_string(key_password)?;
@@ -230,7 +227,7 @@ pub extern "C" fn proxmox_backup_new(
             backup_type: String::from("vm"),
             backup_id,
             password,
-            backup_time,
+            backup_time: backup_time as i64,
             keyfile,
             key_password,
             fingerprint,
-- 
2.27.0






More information about the pbs-devel mailing list