Merge pull request #271 from deg4uss3r/degausser/ignore_means_really_ignore
The new exclude flag excludes the specified crates from building in the temp project to prevent collisions
diff --git a/Cargo.lock b/Cargo.lock
index 5f1dc39..6302b41 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -140,7 +140,7 @@
[[package]]
name = "cargo-outdated"
-version = "0.9.16"
+version = "0.9.17"
dependencies = [
"anyhow",
"cargo",
diff --git a/Cargo.toml b/Cargo.toml
index c8f4433..5746e5e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "cargo-outdated"
-version = "0.9.16"
+version = "0.9.17"
authors = [
"Kevin K. <kbknapp@gmail.com>",
"Frederick Z. <frederick888@tsundere.moe>",
diff --git a/README.md b/README.md
index 7b5a7f7..4b52509 100644
--- a/README.md
+++ b/README.md
@@ -112,7 +112,8 @@
-h, --help Prints help information
--format FORMAT Output formatting [default: list]
[values: list, json]
- -i, --ignore DEPENDENCIES Space separated list of dependencies to ignore
+ -i, --ignore DEPENDENCIES Comma separated list of dependencies to not print in the output
+ -x, --exclude DEPENDENCIES Comma separated list of dependencies to exclude from building
-q, --quiet Suppresses warnings
-R, --root-deps-only Only check root dependencies (Equivalent to --depth=1)
-V, --version Prints version information
diff --git a/src/cargo_ops/temp_project.rs b/src/cargo_ops/temp_project.rs
index 3aaa4a7..dfdf76a 100644
--- a/src/cargo_ops/temp_project.rs
+++ b/src/cargo_ops/temp_project.rs
@@ -280,6 +280,7 @@
}
Self::manipulate_dependencies(&mut manifest, &|deps| {
Self::replace_path_with_absolute(
+ &self,
deps,
orig_root.as_ref(),
tmp_root.as_ref(),
@@ -330,6 +331,7 @@
}
Self::manipulate_dependencies(&mut manifest, &|deps| {
Self::replace_path_with_absolute(
+ &self,
deps,
orig_root.as_ref(),
tmp_root.as_ref(),
@@ -471,6 +473,15 @@
) -> CargoResult<()> {
let dep_keys: Vec<_> = dependencies.keys().cloned().collect();
for dep_key in dep_keys {
+ // this, by brute force, allows a user to exclude a dependency by not writing
+ // it to the temp project's manifest
+ // In short this allows cargo to build the package with semver minor compatibilities issues
+ // https://github.com/rust-lang/cargo/issues/6584
+ // https://github.com/kbknapp/cargo-outdated/issues/230
+ if self.options.flag_exclude.contains(&dep_key) {
+ continue;
+ }
+
let original = dependencies.get(&dep_key).cloned().unwrap();
match original {
@@ -599,6 +610,7 @@
}
fn replace_path_with_absolute(
+ &self,
dependencies: &mut Table,
orig_root: &Path,
tmp_root: &Path,
diff --git a/src/main.rs b/src/main.rs
index d1b642d..7b903c5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -23,7 +23,8 @@
-h, --help Prints help information
--format FORMAT Output formatting [default: list]
[values: list, json]
- -i, --ignore DEPENDENCIES Space separated list of dependencies to ignore
+ -i, --ignore DEPENDENCIES Comma separated list of dependencies to not print in the output
+ -x, --exclude DEPENDENCIES Comma separated list of dependencies to exclude from building
-q, --quiet Suppresses warnings
-R, --root-deps-only Only check root dependencies (Equivalent to --depth=1)
-V, --version Prints version information
@@ -49,6 +50,7 @@
flag_color: Option<String>,
flag_features: Vec<String>,
flag_ignore: Vec<String>,
+ flag_exclude: Vec<String>,
flag_manifest_path: Option<String>,
flag_quiet: bool,
flag_verbose: u32,
@@ -100,6 +102,7 @@
}
options.flag_features = flat_split(&options.flag_features);
options.flag_ignore = flat_split(&options.flag_ignore);
+ options.flag_exclude = flat_split(&options.flag_exclude);
options.flag_packages = flat_split(&options.flag_packages);
if options.flag_root_deps_only {
options.flag_depth = Some(1);