Skip to content

Commit

Permalink
Allow building without self_update command
Browse files Browse the repository at this point in the history
The self-update subcommand is undesirable if rustic is installed using
the system package manager.
  • Loading branch information
jirutka committed Dec 30, 2023
1 parent e1cfd57 commit c7572a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ description = { workspace = true }
members = ["crates/rustic_testing", "xtask"]

[features]
default = []
default = ["self-update"]
mimalloc = ["dep:mimalloc"]
jemallocator = ["dep:jemallocator-global"]
self-update = ["dep:self_update", "dep:semver"]

[[bin]]
name = "rustic"
Expand Down Expand Up @@ -67,8 +68,8 @@ serde_with = { workspace = true }

# other dependencies
chrono = { workspace = true }
self_update = { workspace = true }
semver = { workspace = true }
self_update = { workspace = true, optional = true }
semver = { workspace = true, optional = true }

# commands
clap = { workspace = true }
Expand Down
8 changes: 5 additions & 3 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub(crate) mod prune;
pub(crate) mod repair;
pub(crate) mod repoinfo;
pub(crate) mod restore;
#[cfg(feature = "self-update")]
pub(crate) mod self_update;
pub(crate) mod show_config;
pub(crate) mod snapshots;
Expand All @@ -33,8 +34,8 @@ use crate::{
backup::BackupCmd, cat::CatCmd, check::CheckCmd, completions::CompletionsCmd,
config::ConfigCmd, copy::CopyCmd, diff::DiffCmd, dump::DumpCmd, forget::ForgetCmd,
init::InitCmd, key::KeyCmd, list::ListCmd, ls::LsCmd, merge::MergeCmd, prune::PruneCmd,
repair::RepairCmd, repoinfo::RepoInfoCmd, restore::RestoreCmd, self_update::SelfUpdateCmd,
show_config::ShowConfigCmd, snapshots::SnapshotCmd, tag::TagCmd,
repair::RepairCmd, repoinfo::RepoInfoCmd, restore::RestoreCmd, show_config::ShowConfigCmd,
snapshots::SnapshotCmd, tag::TagCmd,
},
config::{progress_options::ProgressOptions, RusticConfig},
{Application, RUSTIC_APP},
Expand Down Expand Up @@ -108,7 +109,8 @@ enum RusticCmd {
ShowConfig(ShowConfigCmd),

/// Update to the latest rustic release
SelfUpdate(SelfUpdateCmd),
#[cfg(feature = "self-update")]
SelfUpdate(self_update::SelfUpdateCmd),

/// Remove unused data or repack repository pack files
Prune(PruneCmd),
Expand Down

0 comments on commit c7572a3

Please sign in to comment.