Skip to content

Commit

Permalink
refactor: Simplify features by making some code always included
Browse files Browse the repository at this point in the history
  • Loading branch information
VorpalBlade committed Aug 11, 2024
1 parent 21b3494 commit 43775d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
8 changes: 2 additions & 6 deletions crates/paketkoll_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ default = []

# Include the Arch Linux backend
arch_linux = [
"__extraction",
"__gzip",
"__sha256",
"__zstd",
Expand All @@ -32,7 +31,6 @@ arch_linux = [
# Include support for the Debian backend
debian = [
"__bzip2",
"__extraction",
"__gzip",
"__md5",
"__xz",
Expand All @@ -59,8 +57,6 @@ __gzip = ["dep:flate2"]
__xz = ["dep:xz2"]
# Internal feature for decompression
__zstd = ["dep:zstd"]
# Internal feature for package extraction
__extraction = ["dep:glob", "dep:tar"]

[dependencies]
ahash.workspace = true
Expand All @@ -76,7 +72,7 @@ either.workspace = true
faster-hex.workspace = true
flate2 = { workspace = true, optional = true }
flume.workspace = true
glob = { workspace = true, optional = true }
glob.workspace = true
ignore.workspace = true
libc.workspace = true
log.workspace = true
Expand All @@ -96,7 +92,7 @@ scopeguard.workspace = true
smallvec.workspace = true
strum.workspace = true
systemd_tmpfiles = { version = "0.1.5", path = "../systemd_tmpfiles", optional = true }
tar = { workspace = true, optional = true }
tar.workspace = true
xz2 = { workspace = true, optional = true }
zstd = { workspace = true, optional = true }

Expand Down
5 changes: 0 additions & 5 deletions crates/paketkoll_core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ impl<'archive, R: Read + 'archive> Read for CompressionFormat<'archive, R> {
}
}

#[cfg(feature = "__extraction")]
pub(crate) fn group_queries_by_pkg(
queries: &[paketkoll_types::backend::OriginalFileQuery],
) -> AHashMap<&str, AHashSet<&str>> {
Expand All @@ -105,7 +104,6 @@ pub(crate) fn group_queries_by_pkg(

/// Attempt to search a directory based cache and if not found, download the
/// package
#[cfg(feature = "__extraction")]
pub(crate) fn locate_package_file(
dir_candidates: &[&str],
package_match: &str,
Expand Down Expand Up @@ -164,7 +162,6 @@ pub(crate) struct PackageQuery<'a> {

/// Attempt to search a directory based cache and return which packages are
/// missing
#[cfg(feature = "__extraction")]
pub(crate) fn missing_packages<'strings>(
dir_candidates: &[&str],
package_matches: impl Iterator<Item = PackageQuery<'strings>>,
Expand Down Expand Up @@ -211,7 +208,6 @@ pub(crate) fn missing_packages<'strings>(
}

/// Extract files from a generic tar archive
#[cfg(feature = "__extraction")]
pub(crate) fn extract_files(
mut archive: tar::Archive<impl Read>,
queries: &AHashSet<&str>,
Expand Down Expand Up @@ -268,7 +264,6 @@ pub(crate) fn extract_files(
}

/// Convert a stream of tar entries to a list of file entries
#[cfg(feature = "__extraction")]
pub(crate) fn convert_archive_entries(
mut archive: tar::Archive<impl std::io::Read>,
pkg_ref: paketkoll_types::intern::PackageRef,
Expand Down

0 comments on commit 43775d2

Please sign in to comment.