Skip to content

Commit

Permalink
uucore: turn backup_control into a feature
Browse files Browse the repository at this point in the history
  • Loading branch information
cakebaker committed Sep 1, 2023
1 parent 4413dd1 commit b41ff2e
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/uu/cp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ filetime = { workspace = true }
libc = { workspace = true }
quick-error = { workspace = true }
selinux = { workspace = true, optional = true }
uucore = { workspace = true, features = ["entries", "fs", "perms", "mode"] }
uucore = { workspace = true, features = [
"backup-control",
"entries",
"fs",
"perms",
"mode",
] }
walkdir = { workspace = true }
indicatif = { workspace = true }

Expand Down
8 changes: 7 additions & 1 deletion src/uu/install/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ clap = { workspace = true }
filetime = { workspace = true }
file_diff = { workspace = true }
libc = { workspace = true }
uucore = { workspace = true, features = ["fs", "mode", "perms", "entries"] }
uucore = { workspace = true, features = [
"backup-control",
"fs",
"mode",
"perms",
"entries",
] }

[[bin]]
name = "install"
Expand Down
2 changes: 1 addition & 1 deletion src/uu/ln/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path = "src/ln.rs"

[dependencies]
clap = { workspace = true }
uucore = { workspace = true, features = ["fs"] }
uucore = { workspace = true, features = ["backup-control", "fs"] }

[[bin]]
name = "ln"
Expand Down
2 changes: 1 addition & 1 deletion src/uu/mv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ path = "src/mv.rs"
clap = { workspace = true }
fs_extra = { workspace = true }
indicatif = { workspace = true }
uucore = { workspace = true, features = ["fs"] }
uucore = { workspace = true, features = ["backup-control", "fs"] }

[[bin]]
name = "mv"
Expand Down
1 change: 1 addition & 0 deletions src/uucore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ windows-sys = { workspace = true, optional = true, default-features = false, fea
[features]
default = []
# * non-default features
backup-control = []
encoding = ["data-encoding", "data-encoding-macro", "z85", "thiserror"]
entries = ["libc"]
fs = ["libc", "winapi-util", "windows-sys"]
Expand Down
2 changes: 2 additions & 0 deletions src/uucore/src/lib/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// file that was distributed with this source code.
// features ~ feature-gated modules (core/bundler file)

#[cfg(feature = "backup-control")]
pub mod backup_control;
#[cfg(feature = "encoding")]
pub mod encoding;
#[cfg(feature = "fs")]
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion src/uucore/src/lib/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ mod parser; // string parsing modules
pub use uucore_procs::*;

// * cross-platform modules
pub use crate::mods::backup_control;
pub use crate::mods::display;
pub use crate::mods::error;
pub use crate::mods::line_ending;
Expand All @@ -38,6 +37,8 @@ pub use crate::parser::parse_time;
pub use crate::parser::shortcut_value_parser;

// * feature-gated modules
#[cfg(feature = "backup-control")]
pub use crate::features::backup_control;
#[cfg(feature = "encoding")]
pub use crate::features::encoding;
#[cfg(feature = "fs")]
Expand Down
1 change: 0 additions & 1 deletion src/uucore/src/lib/mods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// file that was distributed with this source code.
// mods ~ cross-platforms modules (core/bundler file)

pub mod backup_control;
pub mod display;
pub mod error;
pub mod line_ending;
Expand Down

0 comments on commit b41ff2e

Please sign in to comment.