mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-21 12:24:17 +08:00
Improve is_deps case
This commit is contained in:
parent
6a19a12380
commit
84ea44bc27
@ -1412,7 +1412,7 @@ fn main() {
|
||||
};
|
||||
}
|
||||
|
||||
let recipes = match CookRecipe::new_recursive(&recipe_names, WALK_DEPTH) {
|
||||
let recipes = match CookRecipe::get_build_deps_recursive(&recipe_names) {
|
||||
Ok(ok) => ok,
|
||||
Err(err) => {
|
||||
eprintln!(
|
||||
|
||||
@ -6,6 +6,8 @@ use serde::{
|
||||
Deserialize, Serialize,
|
||||
};
|
||||
|
||||
use crate::WALK_DEPTH;
|
||||
|
||||
/// Specifies how to download the source for a recipe
|
||||
#[derive(Debug, Deserialize, PartialEq, Serialize)]
|
||||
#[serde(untagged)]
|
||||
@ -186,9 +188,8 @@ impl CookRecipe {
|
||||
},
|
||||
)?;
|
||||
|
||||
for mut dependency in dependencies {
|
||||
for dependency in dependencies {
|
||||
if !recipes.contains(&dependency) {
|
||||
dependency.is_deps = true;
|
||||
recipes.push(dependency);
|
||||
}
|
||||
}
|
||||
@ -201,6 +202,18 @@ impl CookRecipe {
|
||||
Ok(recipes)
|
||||
}
|
||||
|
||||
pub fn get_build_deps_recursive(
|
||||
names: &[PackageName],
|
||||
) -> Result<Vec<Self>, PackageError> {
|
||||
let mut packages = Self::new_recursive(names, WALK_DEPTH)?;
|
||||
|
||||
for package in packages.iter_mut() {
|
||||
package.is_deps = !names.contains(&package.name);
|
||||
}
|
||||
|
||||
Ok(packages)
|
||||
}
|
||||
|
||||
pub fn get_package_deps_recursive(
|
||||
names: &[PackageName],
|
||||
recursion: usize,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user