]> git.proxmox.com Git - proxmox-backup.git/commitdiff
move manifest and backup_info to pbs-datastore
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 7 Jul 2021 09:34:45 +0000 (11:34 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 7 Jul 2021 09:34:56 +0000 (11:34 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
pbs-datastore/Cargo.toml
pbs-datastore/src/backup_info.rs
pbs-datastore/src/lib.rs
pbs-datastore/src/manifest.rs
src/backup/mod.rs
src/tools/mod.rs

index e66a9bb93f731e0c7760e12970bee1abafd994e0..2f2f9d39d986eada32a21267e4fdc8926bdb9600 100644 (file)
@@ -9,6 +9,7 @@ description = "low level pbs data storage access"
 anyhow = "1.0"
 crc32fast = "1"
 endian_trait = { version = "0.6", features = [ "arrays" ] }
+libc = "0.2"
 log = "0.4"
 nix = "0.19.1"
 openssl = "0.10"
index 34bf26a3b08d1f76ff3e0313b770b0b08b2059c3..f77098ee55d11e8c253a2d81d7040ed7073a6428 100644 (file)
@@ -3,7 +3,7 @@ use std::path::{Path, PathBuf};
 
 use anyhow::{bail, format_err, Error};
 
-use crate::api2::types::{
+use pbs_api_types::{
     BACKUP_ID_REGEX,
     BACKUP_TYPE_REGEX,
     BACKUP_DATE_REGEX,
@@ -372,7 +372,7 @@ impl BackupInfo {
         // backup is considered unfinished if there is no manifest
         self.files
             .iter()
-            .any(|name| name == super::MANIFEST_BLOB_NAME)
+            .any(|name| name == MANIFEST_BLOB_NAME)
     }
 }
 
index 09ba0103aa20e5c08697a79287fd233a9ace8f14..25ec669c09cea5fa45f60fb027f1d0c62354a6fb 100644 (file)
@@ -178,6 +178,7 @@ pub fn backup_group() -> Result<nix::unistd::Group, Error> {
         .ok_or_else(|| format_err!("Unable to lookup backup user."))
 }
 
+pub mod backup_info;
 pub mod catalog;
 pub mod checksum_reader;
 pub mod checksum_writer;
@@ -191,15 +192,19 @@ pub mod data_blob_writer;
 pub mod file_formats;
 pub mod index;
 pub mod key_derivation;
+pub mod manifest;
 pub mod task;
 
+pub use backup_info::{BackupDir, BackupGroup, BackupInfo};
 pub use checksum_reader::ChecksumReader;
 pub use checksum_writer::ChecksumWriter;
 pub use chunker::Chunker;
-pub use crypt_config::{CryptConfig, CryptMode};
+pub use crypt_config::{CryptConfig, CryptMode, Fingerprint};
 pub use crypt_reader::CryptReader;
 pub use crypt_writer::CryptWriter;
+pub use data_blob::DataBlob;
 pub use key_derivation::{
     decrypt_key, load_and_decrypt_key, rsa_decrypt_key_config, rsa_encrypt_key_config,
 };
 pub use key_derivation::{Kdf, KeyConfig, KeyDerivationConfig, KeyInfo};
+pub use manifest::BackupManifest;
index 47f9cadcf9031e3b180e60caed72eebd6ec96b9b..4c6d513720239ad1c5ddc88ad440a793db411ca8 100644 (file)
@@ -1,11 +1,12 @@
-use anyhow::{bail, format_err, Error};
 use std::convert::TryFrom;
 use std::path::Path;
 
+use anyhow::{bail, format_err, Error};
+
 use serde_json::{json, Value};
-use ::serde::{Deserialize, Serialize};
+use serde::{Deserialize, Serialize};
 
-use crate::backup::{BackupDir, CryptMode, CryptConfig, Fingerprint};
+use crate::{BackupDir, CryptMode, CryptConfig, Fingerprint};
 
 pub const MANIFEST_BLOB_NAME: &str = "index.json.blob";
 pub const MANIFEST_LOCK_NAME: &str = ".index.json.lck";
@@ -149,7 +150,7 @@ impl BackupManifest {
 
     // Generate canonical json
     fn to_canonical_json(value: &Value) -> Result<Vec<u8>, Error> {
-        crate::tools::json::to_canonical_json(value)
+        pbs_tools::json::to_canonical_json(value)
     }
 
     /// Compute manifest signature
index dcfb4bd4083fb0b43efb390fcdc418d39f5da94a..c0acc2467d0db3f85d00ae2fa7784c8c397e3803 100644 (file)
@@ -178,6 +178,8 @@ pub fn backup_group() -> Result<nix::unistd::Group, Error> {
     }
 }
 
+pub use pbs_datastore::backup_info;
+pub use pbs_datastore::backup_info::*;
 pub use pbs_datastore::catalog;
 pub use pbs_datastore::catalog::*;
 pub use pbs_datastore::checksum_reader;
@@ -204,9 +206,8 @@ pub use pbs_datastore::index;
 pub use pbs_datastore::index::*;
 pub use pbs_datastore::key_derivation;
 pub use pbs_datastore::key_derivation::*;
-
-mod manifest;
-pub use manifest::*;
+pub use pbs_datastore::manifest;
+pub use pbs_datastore::manifest::*;
 
 mod chunk_stream;
 pub use chunk_stream::*;
@@ -226,10 +227,6 @@ pub use fixed_index::*;
 mod dynamic_index;
 pub use dynamic_index::*;
 
-#[macro_use]
-mod backup_info;
-pub use backup_info::*;
-
 mod prune;
 pub use prune::*;
 
index 1e1ea878f55ae904be6cb77b15181939ad23b51b..1e26bdc3ecf9f001e2d5c1fa72b074fb2d3562cb 100644 (file)
@@ -23,6 +23,7 @@ use proxmox_http::{
     ProxyConfig,
 };
 
+pub use pbs_tools::json;
 pub use pbs_tools::nom;
 pub use pbs_tools::{run_command, command_output, command_output_as_string};
 
@@ -40,7 +41,6 @@ pub mod fuse_loop;
 mod memcom;
 pub use memcom::Memcom;
 
-pub mod json;
 pub mod logrotate;
 pub mod loopdev;
 pub mod lru_cache;