From b8bf6a5c816585c64f78f553e9b5b3b079927413 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 21 Feb 2022 11:39:16 +0100 Subject: [PATCH] split out compression code into new crate 'proxmox-compression' this removes quite a bit of dependecies of proxmox-async Signed-off-by: Dominik Csapak [set proxmox-lang dep to 1.1] Signed-off-by: Wolfgang Bumiller --- Cargo.toml | 1 + Makefile | 1 + proxmox-async/Cargo.toml | 8 +-- proxmox-async/src/lib.rs | 2 - proxmox-compression/Cargo.toml | 27 +++++++++ proxmox-compression/debian/changelog | 5 ++ proxmox-compression/debian/control | 56 +++++++++++++++++++ proxmox-compression/debian/copyright | 16 ++++++ proxmox-compression/debian/debcargo.toml | 7 +++ .../src/compression.rs | 0 proxmox-compression/src/lib.rs | 4 ++ .../src/zip.rs | 2 +- 12 files changed, 119 insertions(+), 10 deletions(-) create mode 100644 proxmox-compression/Cargo.toml create mode 100644 proxmox-compression/debian/changelog create mode 100644 proxmox-compression/debian/control create mode 100644 proxmox-compression/debian/copyright create mode 100644 proxmox-compression/debian/debcargo.toml rename {proxmox-async => proxmox-compression}/src/compression.rs (100%) create mode 100644 proxmox-compression/src/lib.rs rename {proxmox-async => proxmox-compression}/src/zip.rs (99%) diff --git a/Cargo.toml b/Cargo.toml index 4a458d27..a992dd0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ members = [ "proxmox-api-macro", "proxmox-async", "proxmox-borrow", + "proxmox-compression", "proxmox-http", "proxmox-io", "proxmox-lang", diff --git a/Makefile b/Makefile index e4b08a3b..8c72c655 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ CRATES = \ proxmox-api-macro \ proxmox-async \ proxmox-borrow \ + proxmox-compression \ proxmox-http \ proxmox-io \ proxmox-lang \ diff --git a/proxmox-async/Cargo.toml b/proxmox-async/Cargo.toml index 5cd82bbc..81fa4bc8 100644 --- a/proxmox-async/Cargo.toml +++ b/proxmox-async/Cargo.toml @@ -10,18 +10,12 @@ exclude = [ "debian" ] [dependencies] anyhow = "1.0" -bytes = "1.0" -crc32fast = "1" -endian_trait = { version = "0.6", features = ["arrays"] } -flate2 = "1.0" futures = "0.3" lazy_static = "1.4" pin-utils = "0.1.0" -tokio = { version = "1.0", features = ["fs", "net", "rt", "rt-multi-thread", "sync"] } -walkdir = "2" +tokio = { version = "1.0", features = [ "net", "rt", "rt-multi-thread", "sync"] } proxmox-io = { path = "../proxmox-io", version = "1", features = [ "tokio" ] } -proxmox-time = { path = "../proxmox-time", version = "1" } proxmox-lang = { path = "../proxmox-lang", version = "1.1" } [dev-dependencies] diff --git a/proxmox-async/src/lib.rs b/proxmox-async/src/lib.rs index ad540d39..5445f681 100644 --- a/proxmox-async/src/lib.rs +++ b/proxmox-async/src/lib.rs @@ -1,8 +1,6 @@ pub mod blocking; pub mod broadcast_future; -pub mod compression; pub mod io; pub mod net; pub mod runtime; pub mod stream; -pub mod zip; diff --git a/proxmox-compression/Cargo.toml b/proxmox-compression/Cargo.toml new file mode 100644 index 00000000..0b9edf57 --- /dev/null +++ b/proxmox-compression/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "proxmox-compression" +version = "0.1.0" +authors = ["Proxmox Support Team "] +edition = "2018" +license = "AGPL-3" +description = "contains compression utilitites (such as an Zip Encoder for async rust)" + +exclude = [ "debian" ] + +[dependencies] +anyhow = "1.0" +bytes = "1.0" +crc32fast = "1" +endian_trait = { version = "0.6" } +flate2 = "1.0" +futures = "0.3" +tokio = { version = "1.6", features = [ "fs", "io-util"] } +walkdir = "2" + +proxmox-time = { path = "../proxmox-time", version = "1" } +proxmox-io = { path = "../proxmox-io", version = "1", features = [ "tokio" ] } +proxmox-lang = { path = "../proxmox-lang", version = "1.1" } + +[dev-dependencies] +tokio = { version = "1.6", features = [ "macros" ] } + diff --git a/proxmox-compression/debian/changelog b/proxmox-compression/debian/changelog new file mode 100644 index 00000000..3c81e27e --- /dev/null +++ b/proxmox-compression/debian/changelog @@ -0,0 +1,5 @@ +rust-proxmox-compression (0.1.0-1) stable; urgency=medium + + * initial split out of `proxmox-async` + + -- Proxmox Support Team Fri, 18 Feb 2022 11:59:30 +0100 diff --git a/proxmox-compression/debian/control b/proxmox-compression/debian/control new file mode 100644 index 00000000..12fa4e6a --- /dev/null +++ b/proxmox-compression/debian/control @@ -0,0 +1,56 @@ +Source: rust-proxmox-compression +Section: rust +Priority: optional +Build-Depends: debhelper (>= 12), + dh-cargo (>= 25), + cargo:native , + rustc:native , + libstd-rust-dev , + librust-anyhow-1+default-dev , + librust-bytes-1+default-dev , + librust-crc32fast-1+default-dev , + librust-endian-trait-0.6+default-dev , + librust-flate2-1+default-dev , + librust-futures-0.3+default-dev , + librust-proxmox-io-1+default-dev , + librust-proxmox-io-1+tokio-dev , + librust-proxmox-time-1+default-dev , + librust-tokio-1+default-dev , + librust-tokio-1+fs-dev , + librust-tokio-1+io-util-dev , + librust-walkdir-2+default-dev +Maintainer: Proxmox Support Team +Standards-Version: 4.5.1 +Vcs-Git: git://git.proxmox.com/git/proxmox.git +Vcs-Browser: https://git.proxmox.com/?p=proxmox.git +Rules-Requires-Root: no + +Package: librust-proxmox-compression-dev +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + librust-anyhow-1+default-dev, + librust-bytes-1+default-dev, + librust-crc32fast-1+default-dev, + librust-endian-trait-0.6+default-dev, + librust-flate2-1+default-dev, + librust-futures-0.3+default-dev, + librust-proxmox-io-1+default-dev, + librust-proxmox-io-1+tokio-dev, + librust-proxmox-time-1+default-dev, + librust-tokio-1+default-dev, + librust-tokio-1+fs-dev, + librust-tokio-1+io-util-dev, + librust-walkdir-2+default-dev +Provides: + librust-proxmox-compression+default-dev (= ${binary:Version}), + librust-proxmox-compression-0-dev (= ${binary:Version}), + librust-proxmox-compression-0+default-dev (= ${binary:Version}), + librust-proxmox-compression-0.1-dev (= ${binary:Version}), + librust-proxmox-compression-0.1+default-dev (= ${binary:Version}), + librust-proxmox-compression-0.1.0-dev (= ${binary:Version}), + librust-proxmox-compression-0.1.0+default-dev (= ${binary:Version}) +Description: Contains compression utilitites (such as an Zip Encoder for async rust) - Rust source code + This package contains the source for the Rust proxmox-compression crate, + packaged by debcargo for use with cargo and dh-cargo. diff --git a/proxmox-compression/debian/copyright b/proxmox-compression/debian/copyright new file mode 100644 index 00000000..d2d30fc7 --- /dev/null +++ b/proxmox-compression/debian/copyright @@ -0,0 +1,16 @@ +Copyright (C) 2022 Proxmox Server Solutions GmbH + +This software is written by Proxmox Server Solutions GmbH + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . diff --git a/proxmox-compression/debian/debcargo.toml b/proxmox-compression/debian/debcargo.toml new file mode 100644 index 00000000..b7864cdb --- /dev/null +++ b/proxmox-compression/debian/debcargo.toml @@ -0,0 +1,7 @@ +overlay = "." +crate_src_path = ".." +maintainer = "Proxmox Support Team " + +[source] +vcs_git = "git://git.proxmox.com/git/proxmox.git" +vcs_browser = "https://git.proxmox.com/?p=proxmox.git" diff --git a/proxmox-async/src/compression.rs b/proxmox-compression/src/compression.rs similarity index 100% rename from proxmox-async/src/compression.rs rename to proxmox-compression/src/compression.rs diff --git a/proxmox-compression/src/lib.rs b/proxmox-compression/src/lib.rs new file mode 100644 index 00000000..05cf06b3 --- /dev/null +++ b/proxmox-compression/src/lib.rs @@ -0,0 +1,4 @@ +mod compression; +pub use compression::*; + +pub mod zip; diff --git a/proxmox-async/src/zip.rs b/proxmox-compression/src/zip.rs similarity index 99% rename from proxmox-async/src/zip.rs rename to proxmox-compression/src/zip.rs index 04bd4e0a..a84c1c9f 100644 --- a/proxmox-async/src/zip.rs +++ b/proxmox-compression/src/zip.rs @@ -437,7 +437,7 @@ where /// use anyhow::{Error, Result}; /// use tokio::fs::File; /// -/// use proxmox_async::zip::{ZipEncoder, ZipEntry}; +/// use proxmox_compression::zip::{ZipEncoder, ZipEntry}; /// /// #[tokio::main] /// async fn main() -> Result<(), Error> {