From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A343162172 for ; Mon, 21 Feb 2022 11:39:23 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9AFE471DE for ; Mon, 21 Feb 2022 11:39:23 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 16023719F for ; Mon, 21 Feb 2022 11:39:21 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E27A344BDB for ; Mon, 21 Feb 2022 11:39:20 +0100 (CET) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Mon, 21 Feb 2022 11:39:16 +0100 Message-Id: <20220221103918.2407442-3-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220221103918.2407442-1-d.csapak@proxmox.com> References: <20220221103918.2407442-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.156 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_SHORT 0.001 Use of a URL Shortener for very short URL SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pbs-devel] [PATCH proxmox v2 2/2] split out compression code into new crate 'proxmox-compression' X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Feb 2022 10:39:23 -0000 this removes quite a bit of dependecies of proxmox-async Signed-off-by: Dominik Csapak --- 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 4a458d2..a992dd0 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 e4b08a3..8c72c65 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 917e5f5..30cd399 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" } [dev-dependencies] diff --git a/proxmox-async/src/lib.rs b/proxmox-async/src/lib.rs index ad540d3..5445f68 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 0000000..0f98360 --- /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" } + +[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 0000000..3c81e27 --- /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 0000000..12fa4e6 --- /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 0000000..d2d30fc --- /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 0000000..b7864cd --- /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 0000000..05cf06b --- /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 04bd4e0..a84c1c9 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> { -- 2.30.2